Skip to content

fix-me/swagger-parser-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swagger-parser-js

const swaggerJson = require('./path/to/your/swagger.json')
const Schema = require('swagger-parser-js')
const schema = new Schema(swaggerJson)

// get properties about the schema
schema.info()
schema.version()
schema.paths()
...
// you get it...

// the useful methods:
// returns an array of Operations
schema.operations()

// returns an array of Operations and also includes `consumes` and `produces` properties
schema.operationsWithRootInherited()

// returns a map of tags to an array of operations for that tag
schema.operationsWithTags()

// returns a map of tags to objects containing tag details and an array of operations
schema.taggedOperations()

// returns a map of tags to objects containing tag details and an array of operations
// each operation has an extra property `x-response-example`
schema.taggedOperationsWithExamples()

// TODO: document this way better
// use flow as documentation?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%