Commit 51e700f
committed
Accept missing "configuration" key for "chunkKeyEncoding".
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.zarr1 parent 74b5396 commit 51e700f
File tree
2 files changed
+12
-4
lines changed- src/main/java/dev/zarr/zarrjava/v3/chunkkeyencoding
2 files changed
+12
-4
lines changedLines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
0 commit comments