-
-
Notifications
You must be signed in to change notification settings - Fork 217
test/vocabulary: ignore unrecognized optional vocabulary #646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test/vocabulary: ignore unrecognized optional vocabulary #646
Conversation
This looks good. It exposed a bug in my implementation, but it's correct. @gregsdennis @Julian Should we include this test in draft-next? When we disallow unknown keywords, this test will require code to identify what keywords are in the vocabulary. Even if the vocabulary is optional, it's necessary to know what keywords are in the vocabulary in order to know if they are allowed to be ignored. |
I think that depends on how we begin to view the optionality of vocabularies. Maybe we need a new discussion to determine if they still make sense in an world where unknown keywords are generally forbidden. That said, I think we add it to |
That's fine with me. |
Sounds fine to me too! |
added to draft2020, draft2019. draft-next working fine with implementation https://github.com/santhosh-tekuri/boon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works in my implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These all work for me as well.
This change allows the tests added in PR json-schema-org/JSON-Schema-Test-Suite#646 to pass, in accordance with §9.3.1 of the spec, "Detecting a Meta-Schema". * Catalog.get_metaschema() is added, and is analogous in behavior to Catalog.get_schema(), relying on Catalog.create_metaschema() * It is called from the now-cached JSONSchema.metaschema property, to keep the parallel with references which are only resolved when used * Catalog.create_metaschema() now returns the created metaschema to avoid having to immediately look it up again * The core_vocabulary parameters have become default_core_vocabulary parameters to allow not knowing the core in advance * The Metaschema constructor now looks in "$vocabulary" for a vocabulary URI matching r'^https://json-schema\.org/draft/[^/]*/core' and if it finds a unique match, uses that instead of the default * Lack of a recognizable core vocabulary still results in a JSONSchemaError exception if no default is provided
This change allows the tests added in PR json-schema-org/JSON-Schema-Test-Suite#646 to pass, in accordance with §9.3.1 of the spec, "Detecting a Meta-Schema". * Catalog.get_metaschema() is added, and is analogous in behavior to Catalog.get_schema(), relying on Catalog.create_metaschema() * It is called from the now-cached JSONSchema.metaschema property, to keep the parallel with references which are only resolved when used * Catalog.create_metaschema() now returns the created metaschema to avoid having to immediately look it up again, as does Catalog.create_vocabulary() * The core_vocabulary parameters have become default_core_vocabulary parameters to allow not knowing the core in advance * The Metaschema constructor now looks in "$vocabulary" for a vocabulary URI matching r'^https://json-schema\.org/draft/[^/]*/core' and if it finds a unique match, uses that instead of the default * Lack of a recognizable core vocabulary still results in a JSONSchemaError exception if no default is provided
This change allows the tests added in PR json-schema-org/JSON-Schema-Test-Suite#646 to pass, in accordance with §9.3.1 of the spec, "Detecting a Meta-Schema". * Catalog.get_metaschema() is added, and is analogous in behavior to Catalog.get_schema(), relying on Catalog.create_metaschema() * It is called from the now-cached JSONSchema.metaschema property, to keep the parallel with references which are only resolved when used * Catalog.create_metaschema() now returns the created metaschema to avoid having to immediately look it up again, as does Catalog.create_vocabulary() * The core_vocabulary parameters have become default_core_vocabulary parameters to allow not knowing the core in advance * The Metaschema constructor now looks in "$vocabulary" for a vocabulary URI matching r'^https://json-schema\.org/draft/[^/]*/core' and if it finds a unique match, uses that instead of the default * Lack of a recognizable core vocabulary still results in a JSONSchemaError exception if no default is provided
This change allows the tests added in PR json-schema-org/JSON-Schema-Test-Suite#646 to pass, in accordance with §9.3.1 of the spec, "Detecting a Meta-Schema". * Catalog.get_metaschema() is added, and is analogous in behavior to Catalog.get_schema(), relying on Catalog.create_metaschema() * It is called from the now-cached JSONSchema.metaschema property, to keep the parallel with references which are only resolved when used * Catalog.create_metaschema() now returns the created metaschema to avoid having to immediately look it up again, as does Catalog.create_vocabulary() * The core_vocabulary parameters have become default_core_vocabulary parameters to allow not knowing the core in advance * The Metaschema constructor now looks in "$vocabulary" for a vocabulary URI matching r'^https://json-schema\.org/draft/[^/]*/core' and if it finds a unique match, uses that instead of the default * Lack of a recognizable core vocabulary still results in a JSONSchemaError exception if no default is provided
working fine with implementation https://github.com/santhosh-tekuri/boon
if test looks fine, will add for draft2019-09 also