class JSONSchema::NodeContext
- JSONSchema::NodeContext
- Reference
- Object
Overview
Tracks the location of a JSON value within a JSON schema.
Defined in:
node_context.crConstructors
Instance Method Summary
-
#dig_into(input : JSON::Any)
Calls
JSON::Any#dig
on a given input to dig to the value represented by this NodeContext. -
#from_property(prop : String)
Create a child NodeContext based on
self
, taking into account whetherself
is the root node. - #parent : NodeContext?
- #parent=(parent : NodeContext?)
- #path : String
- #path=(path : String)
-
#to_s
Get a string representation of the node's full path.
Constructor Detail
Instance Method Detail
def dig_into(input : JSON::Any)
#
Calls JSON::Any#dig
on a given input to dig to the value represented by this NodeContext.
def from_property(prop : String)
#
Create a child NodeContext based on self
, taking into account whether self
is the root node.
def 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.