Closed as not planned
Description
Affects: 2.4.1
When asserting JSON content in a MockMvc, the provided MockMvcResultMatchers.jsonPath
functions support automatic type deduction or an explicit Class<T>
parameter (via #23141), but there is an additional version in JsonPath that supports a TypeRef
generic and is not exposed. It would be very useful if it was, especially for containsInAnyOrder
assertions of POJOs.
For this purpose, it would furthermore be useful if a POJO mapper was configured since afaics it isn't currently.
var configuration = Configuration.defaultConfiguration().mappingProvider(new JacksonMappingProvider());
var document = JsonPath.using(configuration).parse(JSON_DOCUMENT);
var typeRef = new TypeRef<List<Book>>() {};
List<String> titles = document.read("$.store.book", typeRef);