swagger-tagger

1.0.0 • Public • Published

swagger-tagger Build Status

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

A Swagger paths 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

Package Sidebar

Install

npm i swagger-tagger

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • bendrucker