Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/welcomattic/openapi-enricher
Enrich an OpenAPI spec with response examples to mock it efficiently
https://github.com/welcomattic/openapi-enricher
mock openapi
Last synced: 27 days ago
JSON representation
Enrich an OpenAPI spec with response examples to mock it efficiently
- Host: GitHub
- URL: https://github.com/welcomattic/openapi-enricher
- Owner: welcoMattic
- License: mit
- Created: 2022-12-20T09:58:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-15T09:35:12.000Z (8 months ago)
- Last Synced: 2024-10-09T11:17:30.579Z (about 1 month ago)
- Topics: mock, openapi
- Language: JavaScript
- Homepage:
- Size: 89.8 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# OpenAPI Enricher
> Enrich an OpenAPI spec with response examples
## Usage
1. Install openapi-enricher with `npm install openapi-enricher`
2. Write your response exemples in a JSON file, following the provided template (examples.json)
3. Run `npx openapi-enricher openapi.json -e examples.json -o enriched.json`## Examples
Given the petstore OpenAPI specification file [petstore.json](test/fixtures/petstore.json) and a [file containing handwritten response examples](test/fixtures/petstore-examples.json).
By running `npx openapi-enricher petstore.json -e petstore-examples.json -o enriched.json` you can obtain the result exposed in the [enriched.json](test/fixtures/enriched.json) file.Basically, it will merge the `responses` entries of both files.
## Limitations
* It support only examples for response in paths, not for components
* It support only 1 examples file at a time## Credits
* [All contributors](https://github.com/welcomattic/openapi-enricher/graphs/contributors)
## License
OpenAPI Enricher is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.