Accept missing "configuration" key for "chunkKeyEncoding". #42
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