Skip to content

anroopak/json-to-swagger-yaml-schema-with-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-to-swagger-yaml-schema-with-example

Converts a JSON object to corresponding Swagger YAML schema

Setup

$ npm install --save

Usage

$ node json-to-yaml-schema.js '<JSON object>'

Example

$ node json-to-yaml-schema.js '{"json": "abc"}'

->
type: "object"
  properties:
    json:
      type: "string"
      minLength: 1
  required:
    - "json"
  example:
    json: "abc"

About

Converts a JSON object to corresponding Swagger YAML schema

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published