Search before asking
Describe the bug
float[] and double[] are serialized to JSON as { }.
Version Information
jackson-jr-objects 2.18.3
Reproduction
The following code:
var values = new LinkedHashMap<String, Object>();
values.put("intArray", new int[] { 1, 2, 3 });
values.put("longArray", new long[] { 1L, 2L, 3L });
values.put("floatArray", new float[] { 1.0f, 2.0f, 3.0f });
values.put("doubleArray", new double[] { 1.0, 2.0, 3.0 });
System.out.println(JSON.std.with(JSON.Feature.PRETTY_PRINT_OUTPUT).asString(values));
prints:
{
"intArray" : [ 1, 2, 3 ],
"longArray" : [ 1, 2, 3 ],
"floatArray" : { },
"doubleArray" : { }
}
Expected behavior
{
"intArray" : [ 1, 2, 3 ],
"longArray" : [ 1, 2, 3 ],
"floatArray" : [ 1.0, 2.0, 3.0 ],
"doubleArray" : [ 1.0, 2.0, 3.0 ]
}
Search before asking
Describe the bug
float[]anddouble[]are serialized to JSON as{ }.Version Information
jackson-jr-objects 2.18.3
Reproduction
The following code:
prints:
Expected behavior