qri-io / jsonschema

golang implementation of https://json-schema.org drafts 7 & 2019-09
MIT License
461 stars 54 forks source link

fix(RootSchema.Unmarshal): permit opaque properties #45

Closed robfig closed 4 years ago

robfig commented 5 years ago

add a unit test to verify the behavior

fixes #44

robfig commented 5 years ago

Although, it seems like it's worth adding support for the "definitions" key and returning errors for anything under that which doesn't unmarshal as a schema..

robfig commented 5 years ago

Yeah.. not sure this is a good idea as-is. Errors parsing children of "properties" and "items" would no longer be reported.

NikolaLohinski commented 5 years ago

Hi there and thanks for this lib, we really appreciate it !

This feature is a big plus for us, since we need to overload our standard compliant schemas with custom fields. Is there at least a way to set a flag in the rootSchema to enable a kind of "loose" unmarshalling to trigger this behaviour ? The "strict" unmarshalling could still be the default one.

Arqu commented 4 years ago

Closing this as stale as we moved to a newer draft and re-implemented most of jsonschema.