JsonSchema.Parser.UnionParser (json_schema v0.6.0)

Copy Markdown View Source

Parses a JSON schema union type:

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

Into an JsonSchema.Types.UnionType.

Summary

Functions

Returns true if the json subschema represents a union type.

Functions

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

@spec parse(map(), URI.t(), URI.t(), URI.t(), String.t()) ::
  JsonSchema.Parser.ParserResult.t()

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

type?(arg1)

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

Returns true if the json subschema represents a union type.

Examples

iex> type?(%{}) false

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