Giter Site home page Giter Site logo

Comments (2)

carterpage avatar carterpage commented on August 16, 2024 1

If the second one is the expected value, and you use LENIENT or STRICT_ORDER modes, then this will pass. However, if the first one (with age:null) is the expected value, it will fail because technically speaking, the field actually exists in the JSON tree. Therefore, this is WAI. You can try jmayday's advice, or write a scrubber utility to remove null fields before passing it to JSONAssert.

from jsonassert.

jmayday avatar jmayday commented on August 16, 2024

When working with some specific class it's possible to annotate it with @JsonInclude(Include.NON_EMPTY) or also prepare own ObjectMapper implementation with Serializers which redefine isEmpty() method to apply even more sophisticated logic. Details described here FasterXML/jackson-databind#730

But it's tricky for me as well to ignore nulls when dealing with raw jsons (then Include strategy nor custom ObjectMapper doesn't do the job).

from jsonassert.

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.