All Projects → willfarrell → apidoc-plugin-schema

willfarrell / apidoc-plugin-schema

Licence: MIT license
@apiSchema Plugin for apidoc

Programming Languages

javascript
184084 projects - #8 most used programming language

apidoc-plugin-schema

Generates and inject apidoc elements from api schemas.

@apiSchema [(group)] {SCHEMA_TYPE=PATH_TO_SCHEMA} ELEMENT_TYPE

Install

npm install apidoc-plugin-schema --save-dev

Supported Schemas

jsonschema

  • description
  • type
  • array: items
  • object: properties,required
  • integer: minimum,maximum
  • number: minLength,maxLength
  • enum
  • default
  • auto groups object of array/object

Example Use

/**
 * @api {get} /api GetAPI
 * @apiSchema (Body) {jsonschema=./schema/api.req.json} apiParam
 * @apiSchema {jsonschema=./schema/api.res.json} apiSuccess
 */

Developer Note

This plugin uses parser-find-elements @ priority 201.

TODO

  • Add in unit test for jsonschema
  • Add in travis-ci
  • add in xml/wsdl schema type

jsonschema

  • add in support for exclusive number ranges
  • add support for "oneOf":[{"required":[...]},...]
  • add support for "oneOf":[{"type":"string"},...]
  • add support for allOf
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].