The function validate is used to perform validation of an object against a schema. It returns an object (called validation report), which contains an error message for every aspect of the schema, that the object does not conform to. Thus the report builds up the *same structure* as the the schema. If the object conforms to the schema, validate returns an empty object. For convenience the function isValid takes a validation report and returns true for an empty result and false, if the report contains errors.
If the aspect value is a function this can be used within the function to navigate to properties within the object. With this._parent you can navigate up the object tree. Thus it is not recommended to perform validation on objects that do contain a _parent property. When specifying a schema, you should not use the _parent property either.
If the aspect value is a function the following rules apply. The function must return true, if the value of the object fulfills the aspect, otherwise the function should return a String containing an error message or false, which will produce a generic error message. Exceptions that occur within the function are considered an error message also.
Validate an object against a schema.
Return true, if a validation result is empty (containing no validation errors). False, otherwise.
Defines the term optional for use in schemas. Works only for functions at the moment.
Defines the term arrayOf for use in schemas. Works on functions and schemas.
Defines the term ISO date for use in Schemas.