Members
- 
			schema :object
- 
	DescriptionThe schema that defines the validation rules. This should probably be defined at the prototype for each 
 object or model classification. It can be an anonymous schema defined right here, or this can be
 registered schema names to use, or just a single nameDetails
- 
			schemas :object
- 
	DescriptionIf you want to register multiple schemas, use this property instead Details
- 
			_defaultSchemaName :string|function
- 
	DescriptionThe default name of the scheman when you use anonymous schemas. You can define this at the prototype for classified 
 schemas. The can alsoDetails
- 
			validationOptions :object|function
- 
	DescriptionThe options to pass to the validator when it runs Details
Methods
- 
			validate( [ record ], schemaName [, options ] ) → {object}
- 
	DescriptionValidate an object against the schema ParametersName Type Attributes Description recordobject <optional> The record to validate schemaNamestring | object The name of a previously registered schema optionsobject <optional> Options to pass to the validator ReturnsExamples// This supports these signatures: instance.validate(record, schemaName, options); instance.validate(); // this, this._defaultSchemaName, this.validationOptions instance.validate(record); // record, this._defaultSchemaName, this.validationOptions instance.validate(schemaName); //this, schemaName, this.validationOptions instance.validate(record, schemaName); //record, schemaName, this.validationOptions instance.validate(schemaName, options); //this, schemaName, this.validationOptionsDetails
- 
			registerSchemas( schemas )
- 
	DescriptionInitialize the schema collection by registering the with the handler. You can call this at any time and as often as you like. It will be called once 
 by the constructor on any instance schemasParametersName Type Description schemashash A hash of schemas where the key is the name of the schema Details
- 
			extract( [ record [, schema ] ] )
- 
	DescriptionExtracts only the elements of the object that are defined in the schema ParametersName Type Attributes Description recordobject <optional> The record to extract from schemastring <optional> The name of the schema to attach Details
- 
			addType( name, operation ) → {boolean}
- 
	DescriptionCreate a type to be used in your schemas to define new validators ParametersName Type Description namestring The name of the type operationfunction What to do with the type. Name Type Description valueobject The value to validation ReturnsDetails
- 
			addFormat( name, formatter ) → {boolean}
- 
	DescriptionIt is also possible to add support for additional string formats through the addFormat function. ParametersName Type Description namestring The name of the formatter formatterfunction How to format it Name Type Description valueobject The value to format ReturnsDetails
- 
			addCheck( name, formatter ) → {boolean}
- 
	DescriptionIt is possible to add support for custom checks (i.e., minItems, maxItems, minLength, maxLength, etc.) through the addCheck function ParametersName Type Description namestring The name of the check formatterfunction Perform the check Name Type Description valueobject The value to check followed by any parameters from the schema ReturnsDetails
- 
			addTypeCoercion( name, coercer ) → {boolean}
- 
	DescriptionCustom coercion rules ParametersName Type Description namestring The name of the coercion coercerfunction Perform the coercion Name Type Description valueobject The value to coerce ReturnsDetails
- 
			getSchema( [ schemaName ] ) → {object}
- 
	DescriptionGet a registered schema by name ParametersName Type Attributes Description schemaNamestring <optional> ReturnsDetails
- 
			extract( [ schema [, src ] ] ) → {object}
- 
	DescriptionThis method will create a new object that contains only the fields and no methods or other artifacts. This is useful 
 for creating objects to pass over the wire or save in a table. This is not deeply copied, so changes made to the
 extracted object will be represented in this class for reference objects.ParametersName Type Attributes Description schemastring <optional> The schema name to use srcobject <optional> The object to extract fields from ReturnsDetails
- 
			defaultDoc( schema ) → {object}
- 
	DescriptionBuilds a default document based on the schema. What this does is create a document from schema and for each property 
 that has a default value or is required, the resultant object will contain that property. It is useful for extending
 values from some source that may be incomplete, like options or some such.ParametersName Type Description schemajson-schema A schema to use to create the default document ReturnsDetails