json-flattener icon indicating copy to clipboard operation
json-flattener copied to clipboard

Bug in flattening byte arrays fields from Jackson objects

Open cbornet opened this issue 9 months ago • 2 comments

Byte array fields of Jackson objects are not serialized. If you have the following

JsonNode jsonNode = new ObjectMapper().valueToTree(jo);
JacksonJsonValue jsonValue = new JacksonJsonValue(jsonNode);
String json = JsonFlattener.flatten(jsonValue)

where jo is a POJO that has a non-null byte[] field, then that field is not serialized and we get a null.

There is a PR to fix this in json-base: https://github.com/wnameless/json-base/pull/9

cbornet avatar Mar 26 '25 12:03 cbornet

Thanks for the contribution! I’ve just released json-flattener:v0.17.3, upgrading to json-base:v2.5.1 with the fix you provided.

wnameless avatar Mar 29 '25 12:03 wnameless

Awesome, thanks!

cbornet avatar Mar 29 '25 13:03 cbornet