contains

operator fun JsonElement.contains(pointer: KPointer): Boolean(source)

Returns whether the path identified by pointer resolves to a value within this element.

Distinguishes "absent" from "present and JsonNull": a path whose value is JsonNull returns true.

Return

true if the path resolves to a value (including kotlinx.serialization.json.JsonNull); false if any segment is absent or out of bounds, or if the path attempts to navigate into a primitive.

Parameters

pointer

The KPointer to test.