JSV.Ref (jsv v0.10.1)
View SourceRepresentation of a JSON Schema reference ($ref
or $dynamicRef
).
Summary
Functions
Encodes the given string as a JSON representation of a JSON pointer, that is
with ~
as ~0
and /
as ~1
.
Creates a new reference from an URL, relative to the given namespace.
Raising version of the parse/2
function.
Like parse/2
but flags the reference as dynamic.
Creates a new pointer reference from a list of path segments.
Creates a new pointer reference from a list of path segments.
Types
Functions
Encodes the given string as a JSON representation of a JSON pointer, that is
with ~
as ~0
and /
as ~1
.
Creates a new reference from an URL, relative to the given namespace.
If the URL is absolute and its namespace is different from the given namespace, returns an absolute URL.
Raising version of the parse/2
function.
Like parse/2
but flags the reference as dynamic.
Creates a new pointer reference from a list of path segments.
The segments can be strings or integers, representing the path components of a JSON pointer.
Examples
iex> JSV.Ref.pointer(["properties", "name"], :root)
{:ok, %JSV.Ref{ns: :root, kind: :pointer, arg: ["properties", "name"], dynamic?: false}}
iex> JSV.Ref.pointer(["items", 0], :root)
{:ok, %JSV.Ref{ns: :root, kind: :pointer, arg: ["items", 0], dynamic?: false}}
Creates a new pointer reference from a list of path segments.
Raising version of the pointer/2
function.