json_schema v0.2.0 JsonSchema.Parser.TypeReferenceParser View Source

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
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.

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

Examples

iex> type?(%{}) false

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