Git Product home page Git Product logo

Comments (1)

jrglee avatar jrglee commented on June 14, 2024

This idea was considered early. But there are a couple of reasons why this design was not implemented

  1. Just like I mentioned in my comment in #6 AssertJ uses overloads of assertThat and allows the type to dictate the assertion strategy. The goal here is to preserve the assertThat(something).customCheck() template. One idea would be to implement a AbstractCharSequenceAssert with a .asJsonDocumentContext() to enable JSON path checks. The downside is you will have to extend org.assertj.core.api.Assertions to replace the default string assertion with the custom assertion.
  2. This library was build on top of JsonPath which a highly configurable library. By doing the conversion under the covers this library will have to assume some default configs and allow configuration points. This kind of change would increase the complexity since it would introduce a lot of coupling with JsonPath.

I think the best solution here is to create your own wrapper like I described in item 1. With that you can write your own abstraction, and make the assertions a lot simpler for your application. There is a balance between integrating multiple libraries together for an app where you can lock down every version, and for a general use utility where you want to keep it simple so more people can use it. I would like to not put effort in glue code because that would introduce integration issues with a lot other libraries and that defeats the purpose of this simple codebase.

from assertj-json.

Related Issues (11)

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.