This is to let JsonUnit know that Spring Framework 6.2.0 is expected to include an o.s.t.w.s.r.ContentResultMatchers::json overload that takes an o.s.t.j.JsonComparator, a BiFunction<@Nullable String, @Nullable String, JsonComparison>, that evaluates a comparison of actual and expected JSON values. JsonUnit may wish to consider this extension mechanism as a complement to its existing Spring Framework integrations.
It looks to me like no official public API of JsonUnit facilitates an ergonomic implementation of JsonComparator but that perhaps the internal Diff would be the implementation to base an extension on. For now, the following is the plainest implementation I can come up with:
This is to let JsonUnit know that Spring Framework 6.2.0 is expected to include an
o.s.t.w.s.r.ContentResultMatchers::json
overload that takes ano.s.t.j.JsonComparator
, aBiFunction<@Nullable String, @Nullable String, JsonComparison>
, that evaluates a comparison of actual and expected JSON values. JsonUnit may wish to consider this extension mechanism as a complement to its existing Spring Framework integrations.It looks to me like no official public API of JsonUnit facilitates an ergonomic implementation of
JsonComparator
but that perhaps the internalDiff
would be the implementation to base an extension on. For now, the following is the plainest implementation I can come up with:See also