-
Notifications
You must be signed in to change notification settings - Fork 42
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
0.4 schemas: add testing infrastructure for strict and base validation #92
Conversation
While uniqueness of each item can be validated, uniqueness of a property is much more complex with JSON schemas
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.
LGTM
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.
I wonder if there is a place to put "Invalid files which we don't yet know how to test via the schema" such as the duplicate axes names example?
These could be useful (alongside the existing examples) to illustrate the spec rules, and also to highlight what isn't caught by the schema (and might need to be validated in other ways)?
Yes on second thought removing this file loses some information as these are legitimately invalid sample files. When we decided to re-explore alternative validation frameworks, this will be useful to keep around to prove we can handle more advanced constraints. I can see two ways to handle that:
|
I'd go with the simplest solution and just create a separate folder for these cases. |
@constantinpape @will-moore the last set of commits should now keep the invalid examples which are not flagged by the JSON schema under a separate folder with associated |
I think it's good to merge. Are there any/many actual schema changes to update the strict schema for v0.4? I assume they'll come in a follow-up PR? |
I don't have anything pending in terms of schemas addition. I would certainly to handle that as follow-up dedicated PRs. Should we create a reference issue to capture these tasks? Capturing a list of things coming to my mind:
|
Follow-up of #87
This makes a minimal set of modifications allowing to test the JSON samples against both the base image schema and the strict image schemas.
$id
and the$ref
to use 0.4 and define an$id
for the strict schematest_validation
logic to load both schemas and useRefResolver
to resolve the base schematest_validation
tests to validate against both base and strict schemas for valid examplesvalid
andvalid_strict
for clarity (better suggestion welcome)missing_name.json
under the corresponding folderduplicate_axes_name.json
sample - validating these types of constraints might require a more advanced framework