https://github.com/openapi-library/OpenAPIValidators
Use Jest or Chai to assert that HTTP responses satisfy an OpenAPI spec
https://github.com/openapi-library/OpenAPIValidators
chai chai-plugin jest jest-tests openapi openapi-specification openapi-validation openapi3
Last synced: about 2 months ago
JSON representation
Use Jest or Chai to assert that HTTP responses satisfy an OpenAPI spec
- Host: GitHub
- URL: https://github.com/openapi-library/OpenAPIValidators
- Owner: openapi-library
- License: mit
- Created: 2019-07-30T08:56:01.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T14:59:50.000Z (about 2 years ago)
- Last Synced: 2025-03-12T15:47:45.094Z (2 months ago)
- Topics: chai, chai-plugin, jest, jest-tests, openapi, openapi-specification, openapi-validation, openapi3
- Language: TypeScript
- Homepage:
- Size: 2.51 MB
- Stars: 192
- Watchers: 10
- Forks: 35
- Open Issues: 48
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome - openapi-library/OpenAPIValidators - Use Jest or Chai to assert that HTTP responses satisfy an OpenAPI spec (TypeScript)
README
# OpenAPI Validators


[](https://codecov.io/gh/openapi-library/OpenAPIValidators)
[](https://github.com/openapi-library/OpenAPIValidators/blob/master/LICENSE)
[](https://github.com/openapi-library/OpenAPIValidators/blob/master/CONTRIBUTING.md)Use Jest or Chai to assert that HTTP responses satisfy an OpenAPI spec.
## Problem 😕
If your server's behaviour doesn't match your API documentation, then you need to correct your server, your documentation, or both. The sooner you know the better.
## Solution 😄
These test plugins let you automatically test whether your server's behaviour and documentation match. They extend Jest and Chai to support the [OpenAPI standard](https://swagger.io/docs/specification/about/) for documenting REST APIs. In your JavaScript tests, you can simply assert `expect(responseObject).toSatisfyApiSpec()`
### [jest-openapi](https://github.com/openapi-library/OpenAPIValidators/tree/master/packages/jest-openapi#readme)
[](https://www.npmjs.com/package/jest-openapi)
[](https://www.npmjs.com/package/jest-openapi)### [Chai OpenAPI Response Validator](https://github.com/openapi-library/OpenAPIValidators/tree/master/packages/chai-openapi-response-validator#readme)
[](https://www.npmjs.com/package/chai-openapi-response-validator)
[](https://www.npmjs.com/package/chai-openapi-response-validator)## Contributors ✨
Richard Waller
🚧 💻 📖 👀
Jonny Spruce
💻 📖 👀
Alex Dobeck
💻 🐛
Ben Guthrie
💻 🐛
Martijn Vegter
💻
Ludek
💻 🐛
Tommy Giardina
💻 🐛
Oleksandr Khotemskyi
📖
Amit Keinan
💻
DetachHead
🐛
Kristoffer Karlsson
📖