json_schema v0.3.0 JsonSchema.Parser.UnionParser View Source

Parses a JSON schema union type:

{
  "type": ["number", "integer", "null"]
}

Into an JsonSchema.Types.UnionType.

Link to this section Summary

Functions

Returns true if the json subschema represents a union type.

Link to this section Functions

Link to this function

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

View Source

Parses a JSON schema union type into an JsonSchema.Types.UnionType.

Returns true if the json subschema represents a union type.

Examples

iex> type?(%{}) false

iex> type?(%{"type" => ["number", "integer", "string"]}) true