openapi-enricher
v1.1.0
Published
Enrich an OpenAPI spec with response examples
Downloads
1
Maintainers
Readme
OpenAPI Enricher
Enrich an OpenAPI spec with response examples
Usage
- Install openapi-enricher with
npm install openapi-enricher
- Write your response exemples in a JSON file, following the provided template (examples.json)
- Run
npx openapi-enricher openapi.json -e examples.json -o enriched.json
Examples
Given the petstore OpenAPI specification file petstore.json and a file containing handwritten response examples.
By running npx openapi-enricher petstore.json -e petstore-examples.json -o enriched.json
you can obtain the result exposed in the 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
License
OpenAPI Enricher is licensed under the MIT License - see the LICENSE file for details.