get

Kotlin convenience method to allow expressing JsonPath items in a more succinct way:

val verbosePath = JsonPath.key("key")
.index(0)
.key("sub-key")

val shortPath = JsonPath["key"][0]["sub-key"]
verbosePath == shortPath // true

Return

a new JsonPath with additional Component.Key added

Parameters

name

The key name used to extract the first item in the json object


operator fun get(index: Int): JsonPath<JsonPath.Component.Index>

Kotlin convenience method to allow expressing JsonPath items in a more succinct way:

val verbosePath = JsonPath.index(1)
.index(0)
.key("sub-key")

val shortPath = JsonPath[1][0]["sub-key"]
verbosePath == shortPath // true

Return

a new JsonPath with additional Component.Index added

Parameters

index

The index used to extract the first item in the json array