View Source JsonSchema.Parser.TypeReferenceParser (json_schema v0.4.0)

Parses a JSON schema type reference:

{
  "$ref": "#/definitions/link"
}

Into an JsonSchema.Types.TypeReference.

Link to this section Summary

Functions

Parses a JSON schema type reference into an JsonSchema.Types.TypeReference.

Returns true if the json subschema represents a reference to another schema.

Link to this section Functions

Link to this function

parse(map, parent_id, id, path, name)

View Source
@spec parse(map(), URI.t(), URI.t() | nil, URI.t(), String.t()) ::
  JsonSchema.Parser.ParserResult.t()

Parses a JSON schema type reference into an JsonSchema.Types.TypeReference.

@spec type?(map()) :: boolean()

Returns true if the json subschema represents a reference to another schema.

examples

Examples

iex> type?(%{}) false

iex> type?(%{"$ref" => "#foo"}) true