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?
forked from terrencewwong/swagger-parser-js
-
Notifications
You must be signed in to change notification settings - Fork 0
fix-me/swagger-parser-js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- JavaScript 100.0%