Skip to content

roundfly/Swag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

😎 SWAG

Swag is a CLI tool that when given a Swagger URL which points to JSON deserializes the JSON and filters out redundant key:value pairs, this is then passed to quicktype which outputs code in one of its supported languages. If no language is passed as an argument Swag then defaults to Swift.

For more advanced JSON decoding options I encourage you to look into quicktype, seeing as Swag is just a thin wrapper over it.

Installation

npm install @roundfly/swag

Usage

swag https://my-awesome-api.com/swagger/v1/swagger.json --lang js

Inputing the above in a shell outputs a models.js file with all your Swagger models deserialized.

TODO

  • Add unit tests.
  • Improve error output to stderr.
  • Add more language support.
  • Add a CHANGELOG.md

About

CLI for decoding JSON fetched from Swagger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published