brandur / json_schema

A JSON Schema V4 and Hyperschema V4 parser and validator.
MIT License
230 stars 45 forks source link

Smarter defaults for attributes #81

Closed brandur closed 8 years ago

brandur commented 8 years ago

Change out the attribute default implementation for one that's a little smarter and more cleanly implemented in the Schema class.

The trouble with the current one is that it can't handle a string value for a default because it uses a string itself combined with an eval. This didn't play nicely with the new field definitions for hyper-schemas introduced in #80.

Also adds some new test assertions to help identity a future regression of this issue.