When serializing a numeric literal value, JB4JSON-LD simply outputs the value as JSON number, regardless of the particular type. However, this makes serialization and deserialization not compatible in case of floating point numbers, because a double is serialized as a number but the Jakarta JSON processor reads it as BigDecimal because it cannot know whether the value will fit in a double with the right precission.
JB4JSON-LD should provide the type info with the value (e.g., xsd:double for Java double) so that when the same object is deserialized, correct type is resolved.
When serializing a numeric literal value, JB4JSON-LD simply outputs the value as JSON number, regardless of the particular type. However, this makes serialization and deserialization not compatible in case of floating point numbers, because a
double
is serialized as a number but the Jakarta JSON processor reads it asBigDecimal
because it cannot know whether the value will fit in a double with the right precission.JB4JSON-LD should provide the type info with the value (e.g.,
xsd:double
for Javadouble
) so that when the same object is deserialized, correct type is resolved.