Chai OpenAPI Response Validator
Simple Chai support for asserting that HTTP responses satisfy an OpenAPI spec
If your server’s behavior doesn’t match your API documentation, then you need to correct your server, your documentation, or both. The sooner you find out what to correct, the better.
This Chai OpenAPI Response Validator plugin allows you to automatically test whether your server’s behavior and documentation match. It extends the Chai Assertion Library to support the OpenAPI standard for documenting REST APIs.
What problem does this project solve?
API documentation is critical to fast development of web services. API docs form the contract describing how each service interacts with the outside world.
This tool makes sure your tests reflect your API docs. You just specify your API in an OpenAPI.yaml file, then with one line of code connect your docs to your tests. Every test-run now verifies that your web server really satisfies your docs.
This ensures the integrity of your API docs and automates the writing and maintaining of API tests.
Why should other developers contribute to this project?
This tool evolves to benefit the projects it is used in, of which there is a growing number. We also maintain very high code standards, including 100% code coverage and mutation-testing scores. If that sounds good to you, please read our Contributing Guide and start contributing.