serby / schemata

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

don't makeDefault() on sub-schema properties with null values #30

Closed balaclark closed 8 years ago

balaclark commented 8 years ago

This is causing validation errors when I try to save an object with non-required sub-schema property set to null.

This also brings sub-schema makeDefault() into line with how sub-schema cast() works (see https://github.com/serby/schemata/commit/caed73086f2abe6c9bed279c4ae2feba5a6db575).

serby commented 8 years ago

Can you create a test with sole intent and description of this bug.

serby commented 8 years ago

should not create default values on subschemas when value is null

balaclark commented 8 years ago

The test I added does that, I've renamed it to make it more clear and added one more for undefined values.

balaclark commented 8 years ago

closing this in favour of https://github.com/serby/schemata/pull/31