JsonSchema.Parser.TupleParser (json_schema v0.6.0)

Copy Markdown View Source

Parses a JSON schema array type:

{
  "type": "array",
  "items": [
    { "$ref": "#/rectangle" },
    { "$ref": "#/circle" }
  ]
}

Into a JsonSchema.Types.TupleType.

Summary

Functions

Returns true if the json subschema represents a tuple type.

Functions

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

Parses a JSON schema array type into an JsonSchema.Types.TupleType.

type?(arg1)

@spec type?(JsonSchema.Types.schemaNode()) :: boolean()

Returns true if the json subschema represents a tuple type.

Examples

iex> type?(%{}) false

iex> aTuple = %{"items" => [%{"$ref" => "#foo"}, %{"$ref" => "#bar"}]} iex> type?(aTuple) true