The tool is available for use at https://postman-toolbox.postmansolutions.com/
Use this tool to validate your API spec (OAS/AsyncAPI) against a series of Spectral rules.
Validation will return the elements in the API spec that are being validated (using JSONPath Plus) as well as the result of the Spectral validation.
Enter your Spectral rule in YAML (or quoted JSON) format and an associated API spec that you want to validate against and click the 'Validate' button.
The JSON Path that is identified by the given
clause will be presented to you, along with the results of the spectral valiation.
Please raise an Issue if you find any bugs, or feel free to fork the code and submit a PR.
Currently the spectral parser only supports two functions: pattern
and truthy
. If more are needed please raise an issue on the repo.
The JSON support is limited to fully quoted JSON e.g.
This works correctly.
{
"status": "OK"
}
This doesn't work correctly.
{
status: "OK"
}
This tool is almost entirely self-explanatory and the documentation below is almost exactly what you will find when you click on the help button within the tool. Nevertheless, it is also placed here for the sake of accessibility
Use the Visual Test Composer to generate tests via a handy GUI. Just provide a valid JSON
response from the API you wish to test, and the tool will render a form to help you generate tests/chai assertions.
As you edit the fields within the form, the tests/chai assertions will be dynamically updated. Once you've settled upon
your testing logic, copy and paste the generated tests/chai assertions into Postman!
Chai or more correctly, the Chai Assertion Library is a javascript package focusing on enabling users to author robust tests using Behavior-Driven-Development and/or Test-Driven-Development practices. If you are not familiar with Chai, it is quite ubiquitous within the world-wide API ecosystem and is natively included in the Postman testing sandbox (no need to overcome difficulties with importing external libraries)
- Provide a response from the API you wish to test in the left-most pane.
- Watch as a graphical form and tests are generated before your eyes.
- Tweak the form to modify the generated tests.
- When finished, copy the chai assertions to Postman
The source code for this project is available on
Github.
Please raise an issue there or feel free to submit a PR. Support for this tool is provided on a best-effort basis.
Importantly, this tool is not officially supported by Postman Inc. and was written by members of our Solutions
team to enable and support our customers as much as we are able, but does not have the weight of the entire Postman
organization behind it
All computation/generation for the Visual Test Composer is performed in client-side javascript and no JSON, form information, or chai assertions leave the web browser unless said action is explicitly performed by you.
See LICENSE.