Repository navigation
Accept missing "configuration" key for "chunkKeyEncoding". - #42
Merged
brokkoli71 merged 3 commits intoJan 5, 2026
Conversation
The DefaultChunkKeyEncoding constructor currently requires a
`Configuration` argument, which means that the Jackson deserializer will
fail upon attempting to parse array metadata containing a
`chunk_key_encoding` like this one:
```
"chunk_key_encoding": {
"name": "default"
}
```
Instead, it expects, at a minimum:
```
"chunk_key_encoding": {
"name": "default",
"configuration": {}
}
```
I believe Zarr-Java is being too strict here. It is true that that the
spec for the "Default chunk key encoding" [1] says nothing about the
`configuration` object being optional (it only says that the `separator`
member is optional). But the spec for extension points [2] (and
`chunk_key_encoding` _is_ an extension point) does say that the
`configuration` member MAY be present (and therefore is optional), and
in the absence of any overriding statement, I believe `configuration`
should be considered optional _also_ in the context of the "Default
chunk key encoding" extension.
There are definitely OME-Zarr files out in the wild with a missing
`configuration` member, for example [3].
This commit relaxes the requirement in the constructor of both the
DefaultChunkKeyEncoding and V2ChunkKeyEncoding classes, so that they
accept a missing (null) configuration argument and default to using a
'/' and '.' separator, respectively.
--
[1] https://zarr-specs.readthedocs.io/en/latest/v3/chunk-key-encodings/default/index.html
[2] https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html#extension-definition
[3] https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.5/idr0066/ExpD_chicken_embryo_MIP.ome.zarr
brokkoli71
self-requested a review
December 18, 2025 17:22
brokkoli71
approved these changes
Dec 18, 2025
brokkoli71
left a comment
Contributor
There was a problem hiding this comment.
Hi @gouttegd,
Thanks for the contribution! This seems like a reasonable relaxation to me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
DefaultChunkKeyEncodingconstructor currently requires aConfigurationargument, which means that the Jackson deserializer will fail upon attempting to parse array metadata containing achunk_key_encodinglike this one:Instead, it expects, at a minimum:
I believe Zarr-Java is being too strict here. It is true that that the spec for the "Default chunk key encoding" [1] says nothing about the
configurationobject being optional (it only says that theseparatormember is optional). But the spec for extension points [2] (andchunk_key_encodingis an extension point) does say that theconfigurationmember MAY be present (and therefore is optional), and in the absence of any overriding statement, I believeconfigurationshould be considered optional also in the context of the "Default chunk key encoding" extension.There are definitely OME-Zarr files out in the wild with a missing
configurationmember, for example [3].This commit relaxes the requirement in the constructor of both the DefaultChunkKeyEncoding and V2ChunkKeyEncoding classes, so that they accept a missing (null) configuration argument and default to using a
/and.separator, respectively.--
[1] https://zarr-specs.readthedocs.io/en/latest/v3/chunk-key-encodings/default/index.html
[2] https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html#extension-definition
[3] https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.5/idr0066/ExpD_chicken_embryo_MIP.ome.zarr