class

JSONSchema::NodeContext

Inherits Reference / Object

Tracks the location of a JSON value within a JSON schema.

Constructors

new(path : String = ".", parent : Nil | JSONSchema::NodeContext = nil)
Source

Instance methods

dig_into(input : JSON::Any)

Calls JSON::Any#dig on a given input to dig to the value represented by this NodeContext.

Source
from_property(prop : String)

Create a child NodeContext based on self, taking into account whether self is the root node.

Source
parent
Source
parent=(parent : NodeContext | Nil)
Source
path
Source
path=(path : String)
Source
to_s

Get a string representation of the node's full path. The format is dot and square bracket notation, similar to the format expected by jq, a popular JSON querying CLI.

Example: .parent.children[0].example

The top-level . will always refer to the root node.

Source