JsonPointer

Represents a JSON Pointer as defined in RFC 6901.

A JSON Pointer is a string that identifies a specific value within a JSON document using an array of reference tokens. Segments are separated by '/' and may contain '~' (for escaping) characters.

Types

Link copied to clipboard
object Companion

Companion object for creating JsonPointer instances and providing constants.

Properties

Link copied to clipboard
val depth: Int

Returns the number of path segments in this pointer.

Link copied to clipboard

Checks if this pointer is the root pointer.

Link copied to clipboard

Returns the parent pointer of this pointer.

Functions

Link copied to clipboard
operator fun get(index: Int): String

Returns the path segment at the specified index.

Link copied to clipboard
fun getSegment(index: Int): String

Returns the path segment at the specified index.

Link copied to clipboard
operator fun plus(other: JsonPointer): JsonPointer

Concatenates this pointer with another pointer, creating a new pointer with combined segments.

Link copied to clipboard

Pops the first segment from this pointer, returning both the segment and a new pointer without that segment.

Link copied to clipboard

Returns the URI fragment identifier representation of this pointer, as defined in RFC 6901 §6.

Link copied to clipboard
open override fun toString(): String

Returns the string representation of this pointer.