swagger-tagger
v1.0.0
Published
Validate and format swagger tags
Downloads
9
Maintainers
Readme
swagger-tagger
Validate and format swagger tags
Install
$ npm install --save swagger-tagger
Usage
var Tags = require('swagger-tagger')
var tags = Tags({
tags: {
foo: 'bar',
beep: 'boop'
},
paths: {
'/abc': {
get: {
tags: ['beep', 'foo']
}
}
}
})
//=> [{name: 'beep', description: 'boop'}, ...]
API
Tags(data)
-> array[tag]
data
Required
Type: object
paths
Required
Type: object
tags
Required
Type: object
An object where keys are tag names and values are the tag description.
sort
Type: function
Default: undefined
A sort function for sorting the output array of tags by tag name. The default uses JavaScript's default alphabetical sorting.
License
MIT © Ben Drucker