Skip to content

stonerich/json-to-swagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-to-swagger

Generates a swagger 2.0 (open-api) specification from a json file with exemplar data. This is done with javascript meant to be run on node.

The swagger definition is meant to be usable when using the json-server, https://github.com/typicode/json-server, but might also be usable as a starting point for swagger specifications for other servers.

Current status = Alpha. Only generate 'get' and 'post' for the root paths in the examplar data.

The json exemplar file is per default assumed to be in "db.json" and output is created in "swagger.json". The swagger file has a default host of "localhost:3000". All of those can be set with the --input, --output and --host command line parameters respectively.

All code is for the moment in the index.js file. It uses the 'command-line-args' node module to parse the command line.

About

Generates a swagger 2.0 (open-api) specification from a json file with exemplar data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published