JsonObjectPath

A JsonPath that can be applied to a JSON object to represent the path to a potentially nested value. Nested items can be in both JSON objects and JSON arrays.

To create a basic JsonObjectPath you can call JsonPath.root with a String.

JsonPath.root("container")

// or for Kotlin users only
JsonPath["container"]

To create a path like container.array[0].property you can use either JsonPath.key or JsonPath.index for each subsequent path component.

JsonPath.root("container")
.key("array")
.index(0)
.key("property")

// or for Kotlin users only
JsonPath["container"]["array"][0]["property"]