ome / ome/ngff

[Issue]: minContains on ome.series is inert, so an empty series validates

Open
#602 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
171
Forks
75
Avg merge
2d 3h
Merged PRs (30d)
20

Description

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:

  1. 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.
  2. 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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with schemas/ome.schema and compare the series definition across the 0.4, 0.5, 0.6rc0, main, and 0.9dev schemas. Read schemas/axes.schema on main to see the existing contains/minContains pattern, then confirm with maintainers whether empty series is intended to validate. Done means the decision is reflected consistently in the affected schemas and the empty-series behavior is checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.