Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 1 month 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T14:59:50.000Z (over 1 year ago)
- Last Synced: 2024-10-13T23:41:57.926Z (about 1 month ago)
- Topics: chai, chai-plugin, jest, jest-tests, openapi, openapi-specification, openapi-validation, openapi3
- Language: TypeScript
- Homepage:
- Size: 2.51 MB
- Stars: 190
- Watchers: 11
- Forks: 35
- Open Issues: 47
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# OpenAPI Validators
![build status](https://github.com/openapi-library/OpenAPIValidators/actions/workflows/ci.yml/badge.svg)
![style](https://img.shields.io/badge/code%20style-airbnb-ff5a5f.svg)
[![codecov](https://codecov.io/gh/openapi-library/OpenAPIValidators/branch/master/graph/badge.svg)](https://codecov.io/gh/openapi-library/OpenAPIValidators)
[![MIT License](https://img.shields.io/npm/l/openapi-validator.svg?style=flat-square)](https://github.com/openapi-library/OpenAPIValidators/blob/master/LICENSE)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](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)
[![downloads](https://img.shields.io/npm/dm/jest-openapi)](https://www.npmjs.com/package/jest-openapi)
[![npm](https://img.shields.io/npm/v/jest-openapi.svg)](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)
[![downloads](https://img.shields.io/npm/dm/chai-openapi-response-validator)](https://www.npmjs.com/package/chai-openapi-response-validator)
[![npm](https://img.shields.io/npm/v/chai-openapi-response-validator.svg)](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
📖