JsonSchema.Parser.EnumParser (json_schema v0.6.0)

Copy Markdown View Source

Parse a JSON schema enum type:

{
  "type": "string",
  "enum": ["none", "green", "orange", "blue", "yellow", "red"]
}

Into an JsonSchema.Types.EnumType.

Summary

Functions

Returns true if the json subschema represents an enum type.

Functions

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

Parses a JSON schema enum type into an JsonSchema.Types.EnumType.

type?(arg1)

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

Returns true if the json subschema represents an enum type.

Examples

iex> type?(%{}) false

iex> type?(%{"enum" => ["red", "yellow", "green"]}) true