JsonSchema.Parser.PrimitiveParser (json_schema v0.6.0)

Copy Markdown View Source

Parses a JSON schema primitive type:

{
  "description": "A name",
  "default": "Steve",
  "type": "string"
}

Into an JsonSchema.Types.PrimitiveType.

Summary

Functions

Returns true if the json subschema represents a primitive type.

Functions

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

Parses a JSON schema primitive type into an JsonSchema.Types.PrimitiveType.

type?(arg1)

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

Returns true if the json subschema represents a primitive type.

Examples

iex> type?(%{}) false

iex> type?(%{"type" => "object"}) false

iex> type?(%{"type" => "boolean"}) true

iex> type?(%{"type" => "integer"}) true