View Source JSV.Builder (jsv v0.3.0)
Internal logic to build raw schemas into JSV.Root
structs.
Summary
Functions
Builds the given raw schema into a JSV.Root
struct.
Ensures that the remote resource that the given reference or key points to is fetched in the builder internal cache
Returns the raw schema identified by the given key. Use ensure_resolved/2
before if the resource may not have been fetched.
Returns a new builder. Builders are not reusable ; a fresh builder must be made for each different root schema.
Adds a new key to be built later. A key is generatlly derived from a reference.
Types
@type buildable() :: {:resolved, resolvable()} | resolvable()
@type resolvable() :: JSV.Resolver.resolvable()
Functions
@spec build(t(), raw_schema()) :: {:ok, JSV.Root.t()} | {:error, term()}
Builds the given raw schema into a JSV.Root
struct.
@spec build_sub(raw_schema(), t()) :: {:ok, JSV.Validator.validator(), t()} | {:error, term()}
@spec ensure_resolved(t(), resolvable()) :: {:ok, t()} | {:error, {:resolver_error, term()}}
Ensures that the remote resource that the given reference or key points to is fetched in the builder internal cache
@spec fetch_resolved(t(), JSV.Key.t()) :: {:ok, raw_schema()} | {:error, term()}
Returns the raw schema identified by the given key. Use ensure_resolved/2
before if the resource may not have been fetched.
Returns a new builder. Builders are not reusable ; a fresh builder must be made for each different root schema.
Adds a new key to be built later. A key is generatlly derived from a reference.