jsonb-api icon indicating copy to clipboard operation
jsonb-api copied to clipboard

Add a config option to allow empty values or not

Open hantsy opened this issue 4 years ago • 1 comments

When serializing an object, Jackson has some configuration to filter the NULL, empty values, but it seems Jsonb config only includes a withNullValues option, and there is no option to ignore empty values, such as:

  • empty string, including whitespace, \t\r\n etc.
  • empty collection/map
  • empty array

hantsy avatar Feb 25 '21 04:02 hantsy

Hi @hantsy , think it relates to https://github.com/eclipse-ee4j/jsonb-api/issues/121 where the instantiation is blocked, for all other cases you can handle it with a setter (setXXX(JsonValue v))

rmannibucau avatar Feb 25 '21 07:02 rmannibucau