jackson-databind icon indicating copy to clipboard operation
jackson-databind copied to clipboard

Feature request: AS_EMPTY as DeserializationFeature

Open jlous opened this issue 3 years ago • 6 comments

I wish I could configure my object mapper to use "Nulls.AS_EMPTY" as default for deserializing list fields.

  • When I design with non-nullable lists, I commonly do so as a general design principle for the entire model, not just particular fields
  • It is sometimes desirable to use the same Pojos for multipe integrations with different requirements. It is therefore good to be able to configure (de)serialisation on a per-integration object mapper level rather than globally on the model.
  • I generally like to keep my domain classes as "clean" as possible

The perfect solution for me would automatically adjust to whether my kotlin field was nullable or not, but a fixed policy will do the job for most cases.

jlous avatar Oct 25 '22 08:10 jlous