
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
swagger-mock-validator
Advanced tools
A CLI tool to validate mocks against swagger specs.
For a list of all the validation rules see RULES.md.
Install the tool using npm
npm install --global swagger-mock-validator
Invoke the tool with a path or url to a swagger file and a path or url to a mock file. These files should be in json format.
swagger-mock-validator /path/to/swagger.json /path/to/pact.json
swagger-mock-validator https://api.com/swagger.json https://pact-broker.com/pact.json
swagger-mock-validator /path/to/swagger.json https://pact-broker.com/pact.json
Invoking this command will confirm the swagger spec and mock are compatible with each other. RULES.md contains the details of what is verified.
If the two files are compatible with each other an exit status of 0 is returned.
If the two files are not compatible with each other an exit status of 1 is returned, along with a message containing the reason why the two files are not compatible.
For more options on how to use the command run the command with the help flag.
swagger-mock-validator --help
Provider services can easily verify all the consumer pact files uploaded to a Pact Broker using this tool. Invoke the tool with a url to the Pact Broker along with the name of the provider service and the tool will automatically discover and validate the latest versions of the consumer pact files for the provider service.
swagger-mock-validator /path/to/swagger.json https://pact-broker.com --provider my-provider-name
The tool can be configured to send analytics events to a server of your choosing. Use the --analyticsUrl
flag to pass a url that the tool should post the event to. The tool will send this event via a http post request and will timeout after 5 seconds. See analytics.ts for the post body schema.
swagger-mock-validator /path/to/swagger.json /path/to/pact.json --analyticsUrl https://analytics-server.com/event
Any errors sending the analytic events are ignored and do not impact the validation results, a successful validation that had an error while trying to send the analytic event is still a successful validation.
By default analytics are disabled. To protect your privacy this is an opt-in feature.
See CHANGELOG.md
See CONTRIBUTING.md
See LICENSE.txt
FAQs
A CLI tool to validate mocks against swagger/OpenApi specs.
The npm package swagger-mock-validator receives a total of 674 weekly downloads. As such, swagger-mock-validator popularity was classified as not popular.
We found that swagger-mock-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.