-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make use of JSONAssert in public API optional #32791
Comments
Good timing considering that stuff is partially moving to Spring Framework and this gives us an opportunity to adapt things a bit. |
We could soften that particular use in the linked issue but Spring Framework 6.2 has more use of JSONAssert with the introduction of the AssertJ support. So if we want to move to something else, we could consider JsonUnit but it already depends on Spring. I don't see us relying on JsonUnit at this stage (@lukas-krecan). @philwebb did you have any other candidates in mind? |
It doesn't look like there's any single candidate that would work as a drop-in replacement, but we could perhaps isolate ourselves a little by not using JSONAssert types in our own API. I sketched something at https://github.com/philwebb/spring-framework/tree/gh-32791 |
We've decided to make the use of JSONAssert optional so that users can remove the library and still use other testing features (such as JSONpath or others). This would align with what we've recently done with JSONPath in our assertJ support. However, we don't intend to offer a way for users to use our json-diff related testing API with a different JSON assertion library. For those cases, they'll have to call that themselves. |
This commit introduces a JsonComparator abstraction, with an implementation using JSONAssert. Previously, JSONAssert was the only choice. Test APIs have been adapted to allow the new abstraction while relying on JSONAssert still for high-level methods. Closes spring-projectsgh-32791 Co-authored-by: Stéphane Nicoll <[email protected]>
Turns out we offered that by allowing a custom |
See spring-projects/spring-boot#15967 (comment) for details.
The user is suggesting that we consider an alternative to
org.skyscreamer:jsonassert
since there's little maintenance activity and little appetite to fix the split package issue.If we do consider something else, we might be able to have
JsonTester
adapt to either library.The text was updated successfully, but these errors were encountered: