apidoc-plugin-example

0.2.0 • Public • Published

apidoc-plugin-example

Generates and inject apidoc example elements from api schemas or files.

@apiExample {SCHEMA_TYPE=PATH_TO_SCHEMA} ELEMENT_TYPE TITLE

Install

npm install apidoc-plugin-example --save-dev

Supported Schema Types

json

Prettifies JSON and injects in.

jsonschema

Uses json-schema-faker to generate a sample response.

Example Use

/**
 * @api {get} /api GetAPI
 * @apiExample {json=./ex/api.req.json} apiParamExample Request
 * @apiExample {jsonschema=./ex/api.res.json} apiSuccessExample Response JSON
 * @apiExample {xml=./ex/api.res.xml} apiSuccessExample Response XML
 */

Developer Note

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

TODO

  • Add in wsdl schema / XSD

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    39
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    39
  • 0.1.0
    0
  • 0.0.2
    30
  • 0.0.1
    0

Package Sidebar

Install

npm i apidoc-plugin-example

Weekly Downloads

69

Version

0.2.0

License

MIT

Last publish

Collaborators

  • willfarrell