JsonSchema.Parser.TypeReferenceParser (json_schema v0.6.0)

Copy Markdown View Source

Parses a JSON schema type reference:

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

Into an JsonSchema.Types.TypeReference.

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.

Functions

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

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

type?(arg1)

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

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

Examples

iex> type?(%{}) false

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