Giter Site home page Giter Site logo

Comments (4)

cowtowncoder avatar cowtowncoder commented on May 24, 2024

Jackson does not consider Maps POJOs, so this is not expected to work the way described.
But there is SerializationFeature.WRITE_NULL_MAP_VALUES, which should work.

Can you see whether disabling that feature works? (and if not, maybe update problem description).

from jackson-module-scala.

meiwin avatar meiwin commented on May 24, 2024

Hi @cowtowncoder
Thanks for your reply, it works!

from jackson-module-scala.

sneharathod avatar sneharathod commented on May 24, 2024

It isnt working for me :(
mapper.setDateFormat(new SimpleDateFormat(DATE_FORMAT));
mapper.setSerializationInclusion(Include.NON_EMPTY);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

from jackson-module-scala.

cowtowncoder avatar cowtowncoder commented on May 24, 2024

NON_NULL check will not work, since "Optionals" (Scala's, JDK8's) are not considered null, but rather "absent".
Furthermore, however, handling as Bean/POJO/POSO property differs from inclusion in Map.
So this:

FasterXML/jackson-databind#818

would need to be implemented to support filtering out of Option from Maps, as well as some code changes in Scala map serializers (since they are not java.util.Maps).

If functionality is desired, I would suggest filing a new issue, as NON_NULL will not work so description here is bit off.

from jackson-module-scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.