New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

snippet-enricher-cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snippet-enricher-cli

Enrich OpenAPI 3.0 JSON with code snippets (``x-codeSamples``)

0.0.8
latest
Source
npm
Version published
Weekly downloads
9.7K
-17.91%
Maintainers
1
Weekly downloads
 
Created
Source

Enrich your OpenAPI 3.0 schema with examples

Thanks to the wonderful swagger-snippet module you can now simply enrich your OpenAPI schema with code samples. It's as easy as 1.2.3.

  • npm install snippet-enricher-cli
  • ./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 to build beautiful API doc:

redoc-cli bundle openapi-with-examples.json

enjoy.

ReDoc API documentation with code samples

Contributing

Contributions are most welcome!

License

MIT

Maintainers

Project is currently maintained, in our spare time, by codewave.eu and a growing number of Contributors!

Keywords

openapi

FAQs

Package last updated on 30 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts