Merge pull request #1138 from strongloop/doc_validation

Update validations.js
This commit is contained in:
Amirali Jafarian 2016-10-14 11:32:55 -04:00 committed by GitHub
commit 459fc93012
1 changed files with 10 additions and 3 deletions

View File

@ -127,9 +127,11 @@ Validatable.validatesNumericalityOf = getConfigurator('numericality');
* ``` * ```
* *
* @param {String} propertyName Property name to validate. * @param {String} propertyName Property name to validate.
* @options {Object} Options * @options {Object} Options See below.
* @property {Array} inArray Property must match one of the values in the array to be valid. * @property {Array} inArray Property must match one of the values in the array to be valid.
* @property {String} message Optional error message if property is not valid. Default error message: "is not included in the list". * @property {String} message Optional error message if property is not valid.
* Default error message: "is not included in the list".
* @property {Boolean} allowNull Whether null values are allowed.
*/ */
Validatable.validatesInclusionOf = getConfigurator('inclusion'); Validatable.validatesInclusionOf = getConfigurator('inclusion');
@ -142,6 +144,7 @@ Validatable.validatesInclusionOf = getConfigurator('inclusion');
* @options {Object} Options * @options {Object} Options
* @property {Array} inArray Property must match one of the values in the array to be valid. * @property {Array} inArray Property must match one of the values in the array to be valid.
* @property {String} message Optional error message if property is not valid. Default error message: "is reserved". * @property {String} message Optional error message if property is not valid. Default error message: "is reserved".
* @property {Boolean} allowNull Whether null values are allowed.
*/ */
Validatable.validatesExclusionOf = getConfigurator('exclusion'); Validatable.validatesExclusionOf = getConfigurator('exclusion');
@ -155,6 +158,7 @@ Validatable.validatesExclusionOf = getConfigurator('exclusion');
* @options {Object} Options * @options {Object} Options
* @property {RegExp} with Regular expression to validate format. * @property {RegExp} with Regular expression to validate format.
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid". * @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {Boolean} allowNull Whether null values are allowed.
*/ */
Validatable.validatesFormatOf = getConfigurator('format'); Validatable.validatesFormatOf = getConfigurator('format');
@ -176,6 +180,7 @@ Validatable.validatesFormatOf = getConfigurator('format');
* @param {Function} validatorFn Custom validation function. * @param {Function} validatorFn Custom validation function.
* @options {Object} Options See below. * @options {Object} Options See below.
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid". * @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {Boolean} allowNull Whether null values are allowed.
*/ */
Validatable.validate = getConfigurator('custom'); Validatable.validate = getConfigurator('custom');
@ -205,8 +210,9 @@ Validatable.validate = getConfigurator('custom');
*``` *```
* @param {String} propertyName Property name to validate. * @param {String} propertyName Property name to validate.
* @param {Function} validatorFn Custom validation function. * @param {Function} validatorFn Custom validation function.
* @options {Object} Options See below * @options {Object} Options See below.
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid". * @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {Boolean} allowNull Whether null values are allowed.
*/ */
Validatable.validateAsync = getConfigurator('custom', { async: true }); Validatable.validateAsync = getConfigurator('custom', { async: true });
@ -231,6 +237,7 @@ Validatable.validateAsync = getConfigurator('custom', { async: true });
* @property {RegExp} with Regular expression to validate format. * @property {RegExp} with Regular expression to validate format.
* @property {Array.<String>} scopedTo List of properties defining the scope. * @property {Array.<String>} scopedTo List of properties defining the scope.
* @property {String} message Optional error message if property is not valid. Default error message: "is not unique". * @property {String} message Optional error message if property is not valid. Default error message: "is not unique".
* @property {Boolean} allowNull Whether null values are allowed.
*/ */
Validatable.validatesUniquenessOf = getConfigurator('uniqueness', { async: true }); Validatable.validatesUniquenessOf = getConfigurator('uniqueness', { async: true });