Describe the issue
schemas/ome.schema constrains series like this:
"series": {
"description": "An array of the same length and the same order as the images defined in the OME-XML",
"type": "array",
"items": {
"type": "string"
},
"minContains": 1
}
In JSON Schema 2020-12, minContains has no effect unless contains is present in the same schema object. There is no contains here, so the keyword is ignored and
{"ome": {"series": [], "version": "0.9.dev1"}}
validates, even though series is required.
The same shape is in the 0.4, 0.5 and 0.6rc0 schemas, and on both main and 0.9dev. By contrast schemas/axes.schema on main pairs minContains with contains, where it does take effect.
Two questions, in order:
- Should an empty
series be valid? The description ties its length to the number of images in the OME-XML, which suggests it should not be.
- If it should not,
minItems: 1 expresses it. That changes which documents validate, so it seemed better to ask here than to fold it into a PR.
Happy to send the change once the first question is settled, or to move the discussion to ome/ngff if the normative half belongs there.
Noticed while vendoring the 0.9.dev1 schemas into ngff-zarr, alongside ome/ngff-spec#195. Related to ome/ngff-spec#194, which asks for JSON linting in the repository: a rule for context-dependent keywords would catch this class of thing.
Describe the issue
schemas/ome.schemaconstrainsserieslike this:In JSON Schema 2020-12,
minContainshas no effect unlesscontainsis present in the same schema object. There is nocontainshere, so the keyword is ignored and{"ome": {"series": [], "version": "0.9.dev1"}}validates, even though
seriesis required.The same shape is in the 0.4, 0.5 and 0.6rc0 schemas, and on both
mainand0.9dev. By contrastschemas/axes.schemaonmainpairsminContainswithcontains, where it does take effect.Two questions, in order:
seriesbe valid? The description ties its length to the number of images in the OME-XML, which suggests it should not be.minItems: 1expresses it. That changes which documents validate, so it seemed better to ask here than to fold it into a PR.Happy to send the change once the first question is settled, or to move the discussion to ome/ngff if the normative half belongs there.
Noticed while vendoring the
0.9.dev1schemas into ngff-zarr, alongside ome/ngff-spec#195. Related to ome/ngff-spec#194, which asks for JSON linting in the repository: a rule for context-dependent keywords would catch this class of thing.