Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/willfarrell/apidoc-plugin-schema
@apiSchema Plugin for apidoc
https://github.com/willfarrell/apidoc-plugin-schema
Last synced: about 2 months ago
JSON representation
@apiSchema Plugin for apidoc
- Host: GitHub
- URL: https://github.com/willfarrell/apidoc-plugin-schema
- Owner: willfarrell
- License: mit
- Created: 2016-04-15T18:01:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-09-30T00:35:54.000Z (almost 3 years ago)
- Last Synced: 2024-07-11T21:46:32.186Z (2 months ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 32
- Watchers: 3
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apidoc-plugin-schema
Generates and inject [apidoc](http://apidoc.com) elements from api schemas.
`@apiSchema [(group)] {SCHEMA_TYPE=PATH_TO_SCHEMA} ELEMENT_TYPE`
## Install
`npm install apidoc-plugin-schema --save-dev`## Supported Schemas
### [jsonschema](http://json-schema.org)
- `description`
- `type`
- `array`: `items`
- `object`: `properties`,`required`
- `integer`: `minimum`,`maximum`
- `number`: `minLength`,`maxLength`
- `enum`
- `default`
- auto groups object of array/object## Example Use
```javascript
/**
* @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`