get

operator fun JsonElement.get(vararg keys: String): JsonElement

Navigates into nested JsonObject children using dot-separated key strings.

Extension operator on JsonElement. Each key in keys may contain dots to traverse multiple levels. Empty segments are ignored, so get("a..b") is the same as get("a.b") and an empty path returns this element. A key that itself contains a dot cannot be reached this way; use getByPath, which splits on /.

Return

the JsonElement found by following all keys in sequence

Parameters

keys

one or more dot-separated key paths

Throws

if any key is not found