Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cdwv/oas3-api-snippet-enricher
Enrich your OpenAPI 3.0 JSON with code samples
https://github.com/cdwv/oas3-api-snippet-enricher
oas oas3 openapi3 swagger
Last synced: about 1 month ago
JSON representation
Enrich your OpenAPI 3.0 JSON with code samples
- Host: GitHub
- URL: https://github.com/cdwv/oas3-api-snippet-enricher
- Owner: cdwv
- License: mit
- Created: 2019-11-09T09:13:16.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-19T17:30:01.000Z (4 months ago)
- Last Synced: 2024-10-04T04:06:22.755Z (about 1 month ago)
- Topics: oas, oas3, openapi3, swagger
- Language: JavaScript
- Size: 172 KB
- Stars: 92
- Watchers: 9
- Forks: 13
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Enrich your OpenAPI 3.0 schema with examples
Thanks to the wonderful [swagger-snippet](https://github.com/ErikWittern/swagger-snippet) module you can now simply enrich your OpenAPI schema with code samples. It's as easy as 1.2.3.
1. ``npm install snippet-enricher-cli``
2. ``./node_modules/.bin/snippet-enricher-cli --input=your_oas.json``## Example Usage
Enrich your OAS 3.0 Schema
```
./node_modules/.bin/snippet-enricher-cli --input=openapi.json > openapi-with-examples.json
```
Alternatively you can point it to a YAML-formatted spec:
```
curl https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml --output petstore.yaml
./node_modules/.bin/snippet-enricher-cli --input=petstore.yaml > openapi-with-examples.json
```Use targets options to specific languages:
```
./node_modules/.bin/snippet-enricher-cli --targets="node_request,shell_curl" --input=openapi.json > openapi-with-examples.json
```Use [ReDoc](https://github.com/Redocly/redoc/) to build beautiful API doc:
```
redoc-cli bundle openapi-with-examples.json
```enjoy.
![ReDoc API documentation with code samples](image.png)
Contributing
=======================================================================Contributions are most welcome!
License
=======================================================================MIT
Maintainers
===========[](http://codewave.eu)
Project is currently maintained, in our spare time, by [codewave.eu](http://codewave.eu) and a growing number of Contributors!