@@ -42,6 +42,7 @@ public class ArrayMetadata implements dev.zarr.zarrjava.core.ArrayMetadata {
4242 @ JsonIgnore
4343 public final Object parsedFillValue ;
4444
45+ @ Nullable
4546 public Codec [] filters ;
4647 @ Nullable
4748 public Codec compressor ;
@@ -56,11 +57,11 @@ public ArrayMetadata(
5657 @ JsonProperty (value = "shape" , required = true ) long [] shape ,
5758 @ JsonProperty (value = "chunks" , required = true ) int [] chunks ,
5859 @ JsonProperty (value = "dtype" , required = true ) DataType dataType ,
59- @ Nullable @ JsonProperty (value = "fill_value" , required = true ) Object fillValue , //todo test when null
60+ @ Nullable @ JsonProperty (value = "fill_value" , required = true ) Object fillValue ,
6061 @ JsonProperty (value = "order" , required = true ) Order order ,
61- @ Nullable @ JsonProperty (value = "dimension_separator" ) Separator dimensionSeparator ,
62- @ Nullable @ JsonProperty (value = "filters" ) Codec [] filters ,
63- @ Nullable @ JsonProperty (value = "compressor " ) Codec compressor
62+ @ Nullable @ JsonProperty (value = "filters" , required = true ) Codec [] filters ,
63+ @ Nullable @ JsonProperty (value = "compressor" , required = true ) Codec compressor ,
64+ @ Nullable @ JsonProperty (value = "dimension_separator " ) Separator dimensionSeparator
6465 ) throws ZarrException {
6566 super ();
6667 if (zarrFormat != this .zarrFormat ) {
@@ -72,7 +73,11 @@ public ArrayMetadata(
7273 this .dataType = dataType ;
7374 this .endianness = dataType .getEndianness ();
7475 this .fillValue = fillValue ;
75- this .parsedFillValue = parseFillValue (fillValue , this .dataType );
76+ if (fillValue == null ) {
77+ this .parsedFillValue = null ;
78+ } else {
79+ this .parsedFillValue = parseFillValue (fillValue , this .dataType );
80+ }
7681 this .order = order ;
7782 this .dimensionSeparator = dimensionSeparator ;
7883 this .filters = filters ;
@@ -107,7 +112,7 @@ public DataType dataType() {
107112 @ Override
108113 public Array allocateFillValueChunk () {
109114 ucar .ma2 .Array outputArray = ucar .ma2 .Array .factory (dataType .getMA2DataType (), chunks );
110- MultiArrayUtils .fill (outputArray , parsedFillValue );
115+ if ( parsedFillValue != null ) MultiArrayUtils .fill (outputArray , parsedFillValue );
111116 return outputArray ;
112117 }
113118
0 commit comments