serby / schemata

Define, create, and validate your business objects based on specified schema.
45 stars 16 forks source link

Check that defaultValue is a function or primitive type, fixes #32 #34

Closed bengourley closed 8 years ago

bengourley commented 8 years ago

This checks in the constructor that all of the defaultValues on the schema properties are either 'primitive' or functions.

The only case where this won't help is in some of our applications I've seen the internal schemata.schema updated. In that case the check has already happened, so it would be possible to get the schema into an invalid state. But that is no worse than the current situation.

bengourley commented 8 years ago

@serby I've updated the error message based on your feedback

serby commented 8 years ago

It's going to have to be a version bump I think.