https://github.com/willfarrell/apidoc-plugin-example
@apiExample
https://github.com/willfarrell/apidoc-plugin-example
apidoc apidoc-plugin
Last synced: 10 months ago
JSON representation
@apiExample
- Host: GitHub
- URL: https://github.com/willfarrell/apidoc-plugin-example
- Owner: willfarrell
- License: mit
- Created: 2016-06-18T15:53:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-21T21:13:10.000Z (almost 7 years ago)
- Last Synced: 2025-04-20T17:42:03.291Z (11 months ago)
- Topics: apidoc, apidoc-plugin
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 2
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apidoc-plugin-example
Generates and inject [apidoc](http://apidocjs.com/) 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](https://json-schema.org)
Uses [json-schema-faker](https://github.com/json-schema-faker/json-schema-faker) to generate a sample response.
## Example Use
```javascript
/**
* @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