JSONPath
A small expression language for picking values out of a JSON document, such as $.id for the id field of the top-level object.
In more detail
A JSONPath expression starts at $, the root of the document, and walks down through field names and array positions. It lets a test or tool check one field without handling the whole document. RFC 9535 standardises the syntax.
Example
MockMvc: .andExpect(jsonPath("$.id").value("one"))Related terms
- MockMvc — Spring's test tool that sends requests through the full Spring MVC machinery to your controllers without opening a real network port.
- JSON — A simple text format for structured data made of keys, values, lists and nested objects.
Taught in
- Testing APIs With MockMvc — Modern Java: Virtual Threads & High-Throughput Services