Add a shortcut for registering a new value type.
The current implementation registers the type in the singleton registry
`ModelBuilder.schemaTypes`.
The API should allow us to to change the implementation to register
the type in the scope of ModelBuilder instance only.
This allows connectors to distinguish between empty array and
undefined/null. For example, mongodb will not override existing array
properties if the value is undefined.
Modify ValidationError constructor to include the model name and
a human-readable representation of the validation errors (messages)
in the error message.
Before this change, the message was pointing the reader
to `err.details`. Most frameworks (e.g. express, mocha) log only
`err.message` but not other error properties, thus the logs were
rather unhelpful.
Example of the new error message:
The `User` instance is not valid. Details: `name` can't be blank.
This allows connectors to distinguish between empty array and
undefined/null. For example, mongodb will not override existing array
properties if the value is undefined.
Modify ValidationError constructor to include the model name and
a human-readable representation of the validation errors (messages)
in the error message.
Before this change, the message was pointing the reader
to `err.details`. Most frameworks (e.g. express, mocha) log only
`err.message` but not other error properties, thus the logs were
rather unhelpful.
Example of the new error message:
The `User` instance is not valid. Details: `name` can't be blank.
This allows connectors to distinguish between empty array and
undefined/null. For example, mongodb will not override existing array
properties if the value is undefined.
Modify ValidationError constructor to include the model name and
a human-readable representation of the validation errors (messages)
in the error message.
Before this change, the message was pointing the reader
to `err.details`. Most frameworks (e.g. express, mocha) log only
`err.message` but not other error properties, thus the logs were
rather unhelpful.
Example of the new error message:
The `User` instance is not valid. Details: `name` can't be blank.