0.0.3 • Published 5 years ago
apidoc-plugin-validation v0.0.3
api-doc-validation-plugin
Document request validation rules with @apiValidator and
@apiValidate annotations.
Installation
npm install --save-dev apidoc-plugin-validationNo need to do extra works. Because this plugin name starts with
apidoc-plugin-* and apidoc will automatically loading the
plugins with this pattern.
Usage
/*
* @apiValidator email Checking the given value is an email.
*/
/*
* @apiValidate user.email email
*/Parse parameters to validation rules
/*
* @apiValidator min:{min} String length of the parameter should exceed
* the given length
*/
/*
* @apiValidate user.password min:8
*
*/Preview

Contribution
All PRs and issues are welcome. And stars are also welcome.