Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.

Overview

Prism - API Mock Servers and Contract Testing

CircleCI NPM Downloads Buy us a tree

Prism is a set of packages for API mocking and contract testing with OpenAPI v2 (formerly known as Swagger) and OpenAPI v3.x.

  • Mock Servers: Life-like mock servers from any API Specification Document.
  • Validation Proxy: Contract Testing for API Consumers and Developers.
  • Comprehensive API Specification Support: OpenAPI 3.0, OpenAPI 2.0 (FKA Swagger) and Postman Collections support.

Demo of Prism Mock Server being called with curl from the CLI

Note: This branch refers to Prism 3.x, which is the current version most likely you will use. If you're looking for the 2.x version, look at the 2.x branch

Overview

🧰 Installation and Usage

Installation

Prism requires NodeJS >= 12 to properly work.

npm install -g @stoplight/prism-cli

# OR

yarn global add @stoplight/prism-cli

For more installation options, see our installation documentation.

Mocking

prism mock https://raw.githack.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml

Validation Proxy

prism proxy examples/petstore.oas2.yaml https://petstore.swagger.io/v2

📖 Documentation and Community

🚧 Roadmap

  • Content Negotiation
  • Security Validation
  • Validation Proxy
  • Custom Mocking
  • Recording / "Learning" mode to create spec files
  • Data Persistence (allow Prism act like a sandbox)

FAQs

Cannot access mock server when using Docker?

Prism uses localhost by default, which usually means 127.0.0.1. When using docker the mock server will be unreachable outside of the container unless you run the mock command with -h 0.0.0.0.

Why am I getting 404 errors when I include my basePath?

OpenAPI v2.0 had a concept called "basePath", which was essentially part of the HTTP path the stuff after host name and protocol, and before query string. Unlike the paths in your paths object, this basePath was applied to every single URL, so Prism v2.x used to do the same. In OpenAPI v3.0 they merged the basePath concept in with the server.url, and Prism v3 has done the same.

We treat OAS2 host + basePath the same as OAS3 server.url, so we do not require them to go in the URL. If you have a base path of api/v1 and your path is defined as hello, then a request to http://localhost:4010/hello would work, but http://localhost:4010/api/v1/hello will fail. This confuses some, but the other way was confusing to others. Check the default output of Prism CLI to see what URLs you have available.

Is there a hosted version of Prism?

Yes, hosted mocking is available as part of Stoplight Platform. Learn More

⚙️ Integrations

  • Stoplight Studio: Free visual OpenAPI designer that comes integrated with mocking powered by Prism.
  • Stoplight Platform: Collaborative API Design Platform for designing, developing and documenting APIs with hosted mocking powered by Prism.

🏁 Help Others Utilize Prism

If you're using Prism for an interesting use case, contact us for a case study. We'll add it to a list here. Spread the goodness 🎉

👏 Contributing

If you are interested in contributing to Prism itself, check out our contributing docs ⇗ and code of conduct ⇗ to get started.

🎉 Thanks

Prism is built on top of lots of excellent packages, and here are a few we'd like to say a special thanks to.

Check these projects out!

Comments
  • Detect unresolvable cirular $refs during prism startup

    Detect unresolvable cirular $refs during prism startup

    User story. As an API mock tester, when I startup PRISM and my OpenAPI spec contains an unresolvable $ref, then I want to receive a notification, so that I can try to fix the problem without having to try to fire that request against the mock by myself.

    Is your feature request related to a problem? i have tried to get started with PRISM and I have a spec with DTO models externalized into a separate file. My spec is affected by bug #390. If you experiment with the $refs, you need to try some calls before you know if it works or not. [15:43:16] » [CLI] ► start Prism is listening on http://127.0.0.1:4010 (...) I'm firing a call manually with Postman (...) [15:43:38] » [NEGOTIATOR] √ success Found a compatible content for */* (node:10040) UnhandledPromiseRejectionWarning: Error: Your schema contains $ref. You must provide specification in the third parameter.

    Describe the solution you'd like During startup, Prism tries to resolve the $refs and outputs a warning if calls use unresolvable $refs.

    Additional context Go with a "Fail fast" approach

    t/bug team/platinum-falcons 
    opened by patrickp-at-work 29
  • Change the amount of data returned by the api

    Change the amount of data returned by the api

    Hello,

    Thanks you guys for creating this. It's very helpful for mocking and creating apis.

    Do you think it would be possible to add a command line arg, to define how much data is sent by the api ? This would be very helpful when we need some endpoint to return more than just one to 3 lines...

    thanks in advance.

    opened by enyosolutions 28
  • Circular $ref pointer not supported

    Circular $ref pointer not supported

    Describe the bug

    A clear and concise description of what the bug is. Pointing prism to a file that contains components that use recursive field definition, Prism fails with the message:

    Circular $ref pointer found at /tmp/test.yaml#/components/schemas/Person/properties/spouse

    To Reproduce

    A minimal API definition triggering the error message:

    info:
      title: "Circular reference example"
      description: "Exemplifies a schema with circular references"
      version: 0.1.0
    
    paths:
      /directory:
        get:
          responses:
            "200":
              description: "The request was successfully processed"
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/Person"
                  example:
                    name: John
                    spouse:
                      name: Cynthia
    
    components:
    
      schemas:
    
        Person:
          nullable: true
          properties:
            name:
              type: string
              nullable: false
            spouse:
              $ref: "#/components/schemas/Person"
    

    Expected behavior

    As the OAS file specifies a valid API, the server should be able to mock that API. While having a circular reference can theoretically lead to a infinite recursion, this can be in practice avoided by having a nullable reference to the child object.

    Environment

    • Prism version: [4.1.0]
    t/bug team/platinum-falcons p/high 
    opened by marcoboi 27
  • [BUG] Prism should support */* by default for DELETE

    [BUG] Prism should support */* by default for DELETE

    I have a simple DELETE endpoint and want to return empty with a 204

    Documentation says

    "Some responses, such as 204 No Content, have no body. To indicate the response body is empty, do not specify a content for the response"

    https://swagger.io/docs/specification/describing-responses/

     /api/calls/{id}:
        delete: # DELETE
          tags:
            - Calls
          description: Delete a call history item
          parameters:
            - $ref: '#/components/parameters/id'
          responses:
            204:
              description: OK
            400:
              description: NOK
            500:
              description: ERROR
    components:
        id:
          in: path
          name: id
          description: id for the item
          required: true
          schema:
            type: integer
            format: int64
    
    
    curl -X DELETE "http://127.0.0.1:4010/api/calls/1" -H "accept: */*"
    or
    curl -X DELETE "http://127.0.0.1:4010/api/calls/1"  
    
    {
    detail: "Unable to find content for application/json, text/plain, */*"
    status: 406
    title: "The server cannot produce a representation for your accept header"
    type: "https://stoplight.io/prism/errors#NOT_ACCEPTABLE"        
    }   
    

    The following is a workaround but it seems like it is pollution in my spec file

      /api/calls/{id}:
        delete: # DELETE
          tags:
            - Calls
          description: Delete a call history item
          parameters:
            - $ref: '#/components/parameters/id'
          responses:
            204:
              description: OK
              content:
                '*/*':
                  schema:
                    type: string
            400:
              description: NOK
            500:
              description: ERROR
    
    t/bug 
    opened by lfmunoz 25
  • Postman plus Prism Proxy causes errors

    Postman plus Prism Proxy causes errors

    Describe the bug I use Postman (https://www.postman.com/) with Prism, with good results. When I put Prism into proxy mode, Postman thinks it didn't get a response (but curl to the same endpoint works fine).

    Prism shows no error messages, the output from Prism is identical whether I make the request through Postman or curl

    Postman's console says "incorrect header check"

    curl shows that Prism is returning a header content-encoding: gzip, which I don't get when I request the live API directly rather than via the Prism proxy.

    To Reproduce

    1. Given this OpenAPI document (actually I'm not sure it matters but I'm using https://github.com/Nexmo/api-specification/blob/master/definitions/verify.yml and hitting the search/ endpoint
    2. Run this CLI command prism proxy verify.yml https://api.nexmo.com/verify
    3. Make a request to the Search endpoint using Postman

    Expected behavior The API response

    Environment (remove any that are not applicable):

    • Library version: 3.2.9
    • OS: Ubuntu 18.04
    • Postman 7.21.1
    • curl: 7.58.0

    Additional context I managed to get things working by adding an additional header to Postman Accept-Encoding and leaving it empty - I think Postman sends this header by default. However curl does not send Accept-Encoding by default and I still see that Prism returns a content-encoding: gzip to curl so while I'm not sure Postman is sending correct headers, I think Prism is also adding something here that doesn't help!

    team/platinum-falcons bug 
    opened by lornajane 24
  • Proxy behaves like mock when upstream returns 501, proxy otherwise

    Proxy behaves like mock when upstream returns 501, proxy otherwise

    User story.

    As a dev, I can do run proxy getting real values from upstream when a route has been implemented upstream, and mocked values when a route has not been implemented upstream, so that I can get the best of both worlds.

    Is your feature request related to a problem?

    I'd like to get real data as soon as it's available, but also continue to get mocked data for routes that are not yet implemented.

    Describe the solution you'd like

    When upstream returns 501 (not implemented), prism behaves as it does in mock mode. Else, it behaves as in proxy mode.

    Additional context

    Add any other context or screenshots about the feature request here.

    t/enhancement t/feature p/medium team/platinum-falcons 
    opened by sandinmyjoints 21
  • [Bug] 422 Response Not Being Used For Validation Response

    [Bug] 422 Response Not Being Used For Validation Response

    Describe the bug

    Hello! I could really use some help and guidance!

    I have an Open API spec that is valid when I used Spectral

    I can successfully run it with Prism

    I have unit tests that validate an endpoint, so I am using Prism like so prism proxy --errors example.yaml http://localhost:8080

    When I send an invalid request it keeps giving me this error

    {
      type: 'https://stoplight.io/prism/errors#UNPROCESSABLE_ENTITY',
      title: 'Invalid request',
      status: 422,
      detail: 'Your request is not valid and no HTTP validation response was found in the spec, so Prism is generating this error for you.',
      validation: [
        {
          location: [Array],
          severity: 'Error',
          code: 'required',
          message: "should have required property 'firstname'"
        },
        {
          location: [Array],
          severity: 'Error',
          code: 'required',
          message: "should have required property 'lastname'"
        },
        {
          location: [Array],
          severity: 'Error',
          code: 'required',
          message: "should have required property 'email'"
        },
        {
          location: [Array],
          severity: 'Error',
          code: 'required',
          message: "should have required property 'password'"
        }
      ]
    }
    

    Which is wild because this DOES exist.

    It keeps stating Your request is not valid and no HTTP validation response was found in the spec, so Prism is generating this error for you which is not true at all because I have a 422 response declared for the endpoint that's being hit!

    I have tried setting a 400 response. I've tried setting different data for the response. And nothing is working.

    What am I doing wrong?

    To Reproduce

    Use this file

    ---
    openapi: '3.0.2'
    
    servers:
        - url: http://localhost:8080
          description: Local deployment from your computer
    
    paths:
        /api/users/register:
            post:
                summary: 'Register New User'
                description: 'Register a new user'
                operationId: 'registerNewUser'
                tags: ['Users']
                requestBody:
                    required: true
                    content:
                        application/json:
                            schema:
                                type: 'object'
                                properties:
                                    firstname:
                                        type: 'string'
                                        minLength: 2
                                        maxLength: 100
                                        example: 'John'
                                    lastname:
                                        type: 'string'
                                        minLength: 2
                                        maxLength: 100
                                        example: 'Roberts'
                                    email:
                                        type: 'string'
                                        minLength: 4
                                        maxLength: 100
                                        example: '[email protected]'
                                    password:
                                        type: 'string'
                                        minLength: 8
                                        maxLength: 50
                                        example: 'abc123456'
                                required:
                                    - firstname
                                    - lastname
                                    - email
                                    - password
                responses:
                    '201':
                        description: Successful registration of a new user
                    '422':
                        description: Failed to register new user
                        content:
                            application/json:
                                schema:
                                    type: 'object'
                                    properties:
                                        message:
                                            type: 'string'
                                            example: 'firstname is required'
    

    Run prism proxy --errors example.yaml http://localhost:8080

    Run this curl command to confirm it works

    curl --location --request POST 'localhost:4010/api/users/register' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    	"firstname": "First",
    	"lastname": "Last",
    	"email": "[email protected]",
    	"password": "This_is_4_str0ng_password!"
    }'
    

    If you want pretty printing you can add json_pp

    curl --location --request POST 'localhost:4010/api/users/register' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    	"firstname": "First",
    	"lastname": "Last",
    	"email": "[email protected]",
    	"password": "This_is_4_str0ng_password!"
    }'
    

    Run this command to confirm it fails

    curl --location --request POST 'localhost:4010/api/users/register' \
    --header 'Content-Type: application/json' \
    --data-raw '{}'
    

    Same, but with pretty printing

    curl --location --request POST 'localhost:4010/api/users/register' \
    --header 'Content-Type: application/json' \
    --data-raw '{}' | json_pp
    

    And the final output is this

    ~/Repositories/example   feature/api_spec_and_test_reconciliation ±  ⬡ v12.17.0  curl --location --request POST 'localhost:4010/api/users/register' \
    --header 'Content-Type: application/json' \
    --data-raw '{}' | json_pp
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   702  100   700  100     2   113k    333 --:--:-- --:--:-- --:--:--  114k
    {
       "detail" : "Your request is not valid and no HTTP validation response was found in the spec, so Prism is generating this error for you.",
       "title" : "Invalid request",
       "type" : "https://stoplight.io/prism/errors#UNPROCESSABLE_ENTITY",
       "status" : 422,
       "validation" : [
          {
             "severity" : "Error",
             "location" : [
                "body"
             ],
             "message" : "should have required property 'firstname'",
             "code" : "required"
          },
          {
             "message" : "should have required property 'lastname'",
             "location" : [
                "body"
             ],
             "severity" : "Error",
             "code" : "required"
          },
          {
             "code" : "required",
             "severity" : "Error",
             "location" : [
                "body"
             ],
             "message" : "should have required property 'email'"
          },
          {
             "message" : "should have required property 'password'",
             "location" : [
                "body"
             ],
             "severity" : "Error",
             "code" : "required"
          }
       ]
    }
    

    Expected behavior

    I expect the responses I created for 422 to be used so that I don't have to worry about Prism returning different payloads than what my server does.

    Questions

    How do I get Prism to not return a generated 422 override?

    Because it keeps generating that validation response I can't integrate it with my tests, because the tests expect a message property to be there.

    I've read through the documentation here:

    • https://meta.stoplight.io/docs/prism/docs/guides/errors.md#unprocessable_entity
    • https://meta.stoplight.io/docs/prism/docs/guides/02-request-validation.md#request-validation

    And none of it provides an explicit example on how to make it so that Prism does not return an auto-generated response.

    Additional context

    • Prism: 4.1.2
    • OS: MacOS
    bug 
    opened by loganknecht 20
  • CORS Headers Options verb

    CORS Headers Options verb

    User story. As a frontend developer, I want to connect to the local mock server, so that I can see mocked responses in my browser.

    Is your feature request related to a problem? I can not connect to the mock server via a secure browser, as the CORS Headers are not set up correctly to allow any origin and any verb (OPTIONS, GET, POST, PATCH, etc.)

    Describe the solution you'd like The stoplight client mock server is sending out widely set CORS headers to allow any origin and any verb - or it allows me to configure it myself.

    Additional context Screenshot 2020-03-03 at 09 55 02

    opened by Primajin 19
  • Find 401/403 responses before 422/400

    Find 401/403 responses before 422/400

    Closes #591

    Checklist

    • [x] Tests have been added (for bug fixes / features)
    • [ ] Docs have been added / updated (for bug fixes / features)

    What kind of change does this PR introduce?

    Bug fix.

    What is the current behavior? What is the new behavior?

    The order of finding a response for an invalid request is now changed from: 422, 400, 401, 403, 422 (.default) to: 401, 403, 422, 400, 422 (.default) 401 and 403 are only checked for if there were security issues

    Does this PR introduce a breaking change?

    No.

    opened by lag-of-death 19
  • feat(JSONSchema): Programmatically extend JSON Schema Faker

    feat(JSONSchema): Programmatically extend JSON Schema Faker

    Checklist

    • [x] Tests have been added (for bug fixes / features)
    • [ ] Docs have been added / updated (for bug fixes / features)

    What kind of change does this PR introduce?

    Feature

    Programatically extend JSON Schema Faker options, formats and keywords.

    The provided solution implemented in #384 is not sufficient for certain use-cases.

    Eg. Generated HTML, localized Faker support, custom functions, etc.

    The goal is to be as randomly realistic to the production API as possible.

    What is the current behavior? What is the new behavior?

    The new behaviour allows custom JSON Schema Faker options, formats and keywords to be added when using the Prism mocking server programmatically.

    The OpenAPI spec allow custom formats for the properties with the type string and custom keywords using extensions

    Example: mocking-server.js

    const { createServer } = require("@stoplight/prism-http-server");
    const { createLogger } = require("@stoplight/prism-core");
    const minimist = require("minimist");
    const { loremIpsum } = require("lorem-ipsum");
    const Chance = require('chance');
    
    
    const { port = 3001, schema: path } = minimist(process.argv);
    
    const JSONSchemaFakerConfig = {
      options: {
        // Available options: https://github.com/json-schema-faker/json-schema-faker/tree/master/docs#available-options
        maxItems: 100,
      },
    
      // https://github.com/json-schema-faker/json-schema-faker/blob/master/docs/USAGE.md#custom-formats
      customFormats: {
        html: loremIpsum({
          count: 5,
          format: "plain",
          units: "paragraphs"
        });
      },
    
      // https://github.com/json-schema-faker/json-schema-faker/blob/master/docs/USAGE.md#extending-dependencies
      extensions: {
        chance: () => {
          const chance = new Chance();
    
          chance.mixin({
            user: () => {
              const first = chance.first();
              const last = chance.last();
              const email = chance.email();
              return `${first} ${last} – ${email}`;
            }
          });
    
          return chance;
        }
      }
    }
    
    const server = createServer(
      { path },
      {
        config: { mock: { dynamic: JSONSchemaFakerConfig } },
        components: {
          logger: createLogger()
        }
      }
    );
    
    server.listen(port).then(() => {
      console.log(`🤖 Mocking server enabled on port ${port}`);
    });
    

    Does this PR introduce a breaking change?

    No.

    opened by vanhoofmaarten 19
  • Error 422, Missing Authorization header param

    Error 422, Missing Authorization header param

    When my requisition is with a header, the response is a 422, saying Missing Authorization Header param, but i put in the requisition -H "Authorization: bearer blabla". Is that an issue? When i use the Authorization as query, it works

    t/bug 
    opened by GuilhermeRizzottoLis 19
  • Bump @typescript-eslint/eslint-plugin from 2.34.0 to 5.48.0

    Bump @typescript-eslint/eslint-plugin from 2.34.0 to 5.48.0

    Bumps @typescript-eslint/eslint-plugin from 2.34.0 to 5.48.0.

    Release notes

    Sourced from @​typescript-eslint/eslint-plugin's releases.

    v5.48.0

    5.48.0 (2023-01-02)

    Bug Fixes

    Features

    • eslint-plugin: specify which method is unbound and added test case (#6281) (cf3ffdd)

    v5.47.1

    5.47.1 (2022-12-26)

    Bug Fixes

    • ast-spec: correct some incorrect ast types (#6257) (0f3f645)
    • eslint-plugin: [member-ordering] correctly invert optionalityOrder (#6256) (ccd45d4)

    v5.47.0

    5.47.0 (2022-12-19)

    Features

    • eslint-plugin: [no-floating-promises] add suggestion fixer to add an 'await' (#5943) (9e35ef9)

    v5.46.1

    5.46.1 (2022-12-12)

    Note: Version bump only for package @​typescript-eslint/typescript-eslint

    v5.46.0

    5.46.0 (2022-12-08)

    Bug Fixes

    • eslint-plugin: [ban-types] update message to suggest object instead of Record<string, unknown> (#6079) (d91a5fc)

    Features

    • eslint-plugin: [prefer-nullish-coalescing] logic and test for strict null checks (#6174) (8a91cbd)

    v5.45.1

    5.45.1 (2022-12-05)

    ... (truncated)

    Changelog

    Sourced from @​typescript-eslint/eslint-plugin's changelog.

    5.48.0 (2023-01-02)

    Features

    • eslint-plugin: specify which method is unbound and added test case (#6281) (cf3ffdd)

    5.47.1 (2022-12-26)

    Bug Fixes

    • ast-spec: correct some incorrect ast types (#6257) (0f3f645)
    • eslint-plugin: [member-ordering] correctly invert optionalityOrder (#6256) (ccd45d4)

    5.47.0 (2022-12-19)

    Features

    • eslint-plugin: [no-floating-promises] add suggestion fixer to add an 'await' (#5943) (9e35ef9)

    5.46.1 (2022-12-12)

    Note: Version bump only for package @​typescript-eslint/eslint-plugin

    5.46.0 (2022-12-08)

    Bug Fixes

    • eslint-plugin: [ban-types] update message to suggest object instead of Record<string, unknown> (#6079) (d91a5fc)

    Features

    • eslint-plugin: [prefer-nullish-coalescing] logic and test for strict null checks (#6174) (8a91cbd)

    5.45.1 (2022-12-05)

    Bug Fixes

    • eslint-plugin: [keyword-spacing] unexpected space before/after in import type (#6095) (98caa92)
    • eslint-plugin: [no-shadow] add call and method signatures to ignoreFunctionTypeParameterNameValueShadow (#6129) (9d58b6b)
    • eslint-plugin: [prefer-optional-chain] collect MetaProperty type (#6083) (d7114d3)
    • eslint-plugin: [sort-type-constituents, sort-type-union-intersection-members] handle some required parentheses cases in the fixer (#6118) (5d49d5d)

    5.45.0 (2022-11-28)

    Bug Fixes

    • eslint-plugin: [array-type] --fix flag removes parentheses from type (#5997) (42b33af)
    • eslint-plugin: [keyword-spacing] prevent crash on no options (#6073) (1f19998)
    • eslint-plugin: [member-ordering] support private fields (#5859) (f02761a)
    • eslint-plugin: [prefer-readonly] report if a member's property is reassigned (#6043) (6e079eb)

    ... (truncated)

    Commits
    • 4ab9bd7 chore: publish v5.48.0
    • cf3ffdd feat(eslint-plugin): specify which method is unbound and added test case (#6281)
    • 6ffce79 chore: publish v5.47.1
    • 0f3f645 fix(ast-spec): correct some incorrect ast types (#6257)
    • ccd45d4 fix(eslint-plugin): [member-ordering] correctly invert optionalityOrder (#6256)
    • a2c08ba chore: publish v5.47.0
    • 9e35ef9 feat(eslint-plugin): [no-floating-promises] add suggestion fixer to add an 'a...
    • 6b3ed1d docs: fixed typo "foo.property" (#6180)
    • c943b84 chore: publish v5.46.1
    • 47241bb docs: overhaul branding and add new logo (#6147)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump eslint-config-prettier from 7.2.0 to 8.6.0

    Bump eslint-config-prettier from 7.2.0 to 8.6.0

    Bumps eslint-config-prettier from 7.2.0 to 8.6.0.

    Changelog

    Sourced from eslint-config-prettier's changelog.

    Version 8.6.0 (2023-01-02)

    • Added: [vue/multiline-ternary]. Thanks to @​xcatliu!

    Version 8.5.0 (2022-03-02)

    • Added: [@​typescript-eslint/space-before-blocks]. Thanks to Masafumi Koba (@​ybiquitous)!

    Version 8.4.0 (2022-02-19)

    Version 8.3.0 (2021-04-24)

    • Added: Support for [@​babel/eslint-plugin]. Thanks to Chip Zhang (@​ChipZhang) for the heads-up! ([eslint-plugin-babel] is still supported, too.)

    Version 8.2.0 (2021-04-13)

    • Added: [flowtype/quotes]. Thanks to Martin Zlámal (@​mrtnzlml)!

    Version 8.1.0 (2021-02-24)

    • Added: [flowtype/object-type-curly-spacing].
    • Added: Dummy files for the configs removed in 8.0.0. The dummy files throw an error that try to guide you how to upgrade.

    Version 8.0.0 (2021-02-21)

    • Changed: All configs have been merged into one!

      To upgrade, change:

      {
        "extends": [
          "some-other-config-you-use",
          "prettier",
          "prettier/@typescript-eslint",
          "prettier/babel",
          "prettier/flowtype",
          "prettier/react",
          "prettier/standard",
          "prettier/unicorn",
          "prettier/vue"
        ]
      }
      

      Into:

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • prism mock exits with fatal Token error message

    prism mock exits with fatal Token error message

    Context

    I was hoping to try out the mock behavior, but the lack of actionable error messages frustrated me and made me look elsewhere

    Current Behavior

    I used the docker getting started guide copying the command and providing the openapi URL:

    $ docker run --init -p 4010:4010 stoplight/prism:4 mock -h 0.0.0.0 https://raw.githubusercontent.com/okta/okta-sdk-java/okta-sdk-root-10.0.0/src/swagger/api.yaml
    [2:23:10 AM] › [CLI] …  awaiting  Starting Prism…
    [2:23:13 AM] › [CLI] ✖  fatal     Token "definitions" does not exist.
    

    I am completely open to that file being invalid OpenAPI according to some definition of invalid, but the tool does not tell me that. Also, I made sure that a copy of Insomnia could actually import it, meaning it was valid for some definition

    Expected Behavior

    Of course, the ultimate expected behavior is that it parses the provided file and generates stubs for its endpoints, but this specific bug is because

    Token "definitions" does not exist.

    does not offer the user any action to take; there are 14 mentions of definitions in that file, and the software is currently angry at one of them, but does not say which one

    Possible Workaround/Solution

    Steps to Reproduce

    1. Execute the console command above
    2. Observe the error

    Environment

    • Version used: "stoplight/prism@sha256:0f582c33a702bbdfc1d47b43f9856ae98b943b2fe54d2265b1cfb37291e5435e" which is the current :4 as of this bug

    • Environment name and version (e.g. Chrome 39, node.js 5.4): the image has "NODE_VERSION=16.17.1" in its environment

    • Operating System and version (desktop or mobile): desktop

    • Link to your environment/workspace/project: see above

    t/bug p/medium triaged 
    opened by mdaniel 3
  • Bump qs from 6.5.2 to 6.5.3

    Bump qs from 6.5.2 to 6.5.3

    Bumps qs from 6.5.2 to 6.5.3.

    Changelog

    Sourced from qs's changelog.

    6.5.3

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] utils.merge: avoid a crash with a null target and a truthy non-array source
    • [Fix] correctly parse nested arrays
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Refactor] utils: reduce observable [[Get]]s
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [Refactor] parse: only need to reassign the var once
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] Clean up license text so it’s properly detected as BSD-3-Clause
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] always use String(x) over x.toString()
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • 298bfa5 v6.5.3
    • ed0f5dc [Fix] parse: ignore __proto__ keys (#428)
    • 691e739 [Robustness] stringify: avoid relying on a global undefined (#427)
    • 1072d57 [readme] remove travis badge; add github actions/codecov badges; update URLs
    • 12ac1c4 [meta] fix README.md (#399)
    • 0338716 [actions] backport actions from main
    • 5639c20 Clean up license text so it’s properly detected as BSD-3-Clause
    • 51b8a0b add FUNDING.yml
    • 45f6759 [Fix] fix for an impossible situation: when the formatter is called with a no...
    • f814a7f [Dev Deps] backport from main
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies 
    opened by dependabot[bot] 0
  • Bump chalk from 4.1.2 to 5.2.0

    Bump chalk from 4.1.2 to 5.2.0

    Bumps chalk from 4.1.2 to 5.2.0.

    Release notes

    Sourced from chalk's releases.

    v5.2.0

    • Improve Deno compatibility (#579) 7443e9f
    • Detect true-color support for GitHub Actions (#579) 7443e9f
    • Detect true-color support for Kitty terminal (#579) 7443e9f
    • Fix test for Azure DevOps environment (#579) 7443e9f

    https://github.com/chalk/chalk/compare/v5.1.2...v5.2.0

    v5.1.2

    • Fix exported styles names (#569) a34bcf6

    https://github.com/chalk/chalk/compare/v5.1.1...v5.1.2

    v5.1.1

    • Improved the names of exports introduced in 5.1.0 (#567) 6e0df05
      • We of course preserved the old names.

    https://github.com/chalk/chalk/compare/v5.1.0...v5.1.1

    v5.1.0

    • Expose style names (#566) d7d7571

    https://github.com/chalk/chalk/compare/v5.0.1...v5.1.0

    v5.0.1

    • Add main field to package.json for backwards compatibility with some developer tools 85f7e96

    https://github.com/chalk/chalk/compare/v5.0.0...v5.0.1

    v5.0.0

    Breaking

    • This package is now pure ESM. Please read this.
      • If you use TypeScript, you need to use TypeScript 4.7 or later. Why.
      • If you use a bundler, make sure it supports ESM and that you have correctly configured it for ESM.
      • The Chalk issue tracker is not a support channel for your favorite build/bundler tool.
      • It's totally fine to stay on Chalk v4. It's been stable for years.
    • Require Node.js 12.20 fa16f4e
    • Move some properties off the default export to individual named exports:
      • chalk.InstanceChalk
      • chalk.supportsColorsupportsColor
      • chalk.stderrchalkStderr
      • chalk.stderr.supportsColorsupportsColorStderr
    • Remove .keyword(), .hsl(), .hsv(), .hwb(), and .ansi() coloring methods (#433) 4cf2e40
      • These were not commonly used and added a lot of bloat to Chalk. You can achieve the same by using the color-convert package.
    • The tagged template literal support moved into a separate package: chalk-template (#524) c987c61
    -import chalk from 'chalk';
    +import chalkTemplate from 'chalk-template';
    

    </tr></table>

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(v4.10.5)
Owner
Stoplight
Stoplight leverages your OpenAPI documents to drive the entire API development process
Stoplight
A mocking library for requests

httmock A mocking library for requests for Python 2.7 and 3.4+. Installation pip install httmock Or, if you are a Gentoo user: emerge dev-python/httm

Patryk Zawadzki 452 Dec 28, 2022
HTTP client mocking tool for Python - inspired by Fakeweb for Ruby

HTTPretty 1.0.5 HTTP Client mocking tool for Python created by Gabriel Falcão . It provides a full fake TCP socket module. Inspired by FakeWeb Github

Gabriel Falcão 2k Jan 6, 2023
A utility for mocking out the Python Requests library.

Responses A utility library for mocking out the requests Python library. Note Responses requires Python 2.7 or newer, and requests >= 2.0 Installing p

Sentry 3.8k Jan 3, 2023
A utility for mocking out the Python Requests library.

Responses A utility library for mocking out the requests Python library. Note Responses requires Python 2.7 or newer, and requests >= 2.0 Installing p

Sentry 3.1k Feb 8, 2021
HTTP client mocking tool for Python - inspired by Fakeweb for Ruby

HTTPretty 1.0.5 HTTP Client mocking tool for Python created by Gabriel Falcão . It provides a full fake TCP socket module. Inspired by FakeWeb Github

Gabriel Falcão 1.9k Feb 6, 2021
A mocking library for requests

httmock A mocking library for requests for Python 2.7 and 3.4+. Installation pip install httmock Or, if you are a Gentoo user: emerge dev-python/httm

Patryk Zawadzki 419 Feb 2, 2021
Asyncio http mocking. Similar to the responses library used for 'requests'

aresponses an asyncio testing server for mocking external services Features Fast mocks using actual network connections allows mocking some types of n

null 93 Nov 16, 2022
This file will contain a series of Python functions that use the Selenium library to search for elements in a web page while logging everything into a file

element_search with Selenium (Now With docstrings ?? ) Just to mention, I'm a beginner to all this, so it it's very possible to make some mistakes The

null 2 Aug 12, 2021
Wraps any WSGI application and makes it easy to send test requests to that application, without starting up an HTTP server.

WebTest This wraps any WSGI application and makes it easy to send test requests to that application, without starting up an HTTP server. This provides

Pylons Project 325 Dec 30, 2022
A collection of testing examples using pytest and many other libreris

Effective testing with Python This project was created for PyConEs 2021 Check out the test samples at tests Check out the slides at slides (markdown o

Héctor Canto 10 Oct 23, 2022
A collection of benchmarking tools.

Benchmark Utilities About A collection of benchmarking tools. PYPI Package Table of Contents Using the library Installing and using the library Manual

Kostas Georgiou 2 Jan 28, 2022
A pytest plugin to run an ansible collection's unit tests with pytest.

pytest-ansible-units An experimental pytest plugin to run an ansible collection's unit tests with pytest. Description pytest-ansible-units is a pytest

Community managed Ansible repositories 9 Dec 9, 2022
This is a bot that can type without any assistance and have incredible speed.

BulldozerType This is a bot that can type without any assistance and have incredible speed. This bot currently only works on the site https://onlinety

null 1 Jan 3, 2022
Parameterized testing with any Python test framework

Parameterized testing with any Python test framework Parameterized testing in Python sucks. parameterized fixes that. For everything. Parameterized te

David Wolever 714 Dec 21, 2022
reCaptchaBypasser For Bypass Any reCaptcha For Selenium Python

reCaptchaBypasser ' Usage : from selenium import webdriver from reCaptchaBypasser import reCaptchaScraper import time driver = webdriver.chrome(execu

Dr.Linux 8 Dec 17, 2022
A modern API testing tool for web applications built with Open API and GraphQL specifications.

Schemathesis Schemathesis is a modern API testing tool for web applications built with Open API and GraphQL specifications. It reads the application s

Schemathesis.io 1.6k Jan 6, 2023
A modern API testing tool for web applications built with Open API and GraphQL specifications.

Schemathesis Schemathesis is a modern API testing tool for web applications built with Open API and GraphQL specifications. It reads the application s

Schemathesis.io 1.6k Dec 30, 2022
Kent - Fake Sentry server for local development, debugging, and integration testing

Kent is a service for debugging and integration testing Sentry.

Will Kahn-Greene 100 Dec 15, 2022
User-interest mock backend server implemnted using flask restful, and SQLAlchemy ORM confiugred with sqlite

Flask_Restful_SQLAlchemy_server User-interest mock backend server implemnted using flask restful, and SQLAlchemy ORM confiugred with sqlite. Backend b

Austin Weigel 1 Nov 17, 2022