json_schema v0.1.0 JsonSchema.Parser.PrimitiveParser View Source

Parses a JSON schema primitive type:

{
  "type": "string"
}

Into an JsonSchema.Types.PrimitiveType.

Link to this section Summary

Functions

Returns true if the json subschema represents a primitive type

Link to this section Functions

Link to this function parse(schema_node, parent_id, id, path, name) View Source

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

Link to this function type?(schema_node) View Source
type?(map()) :: 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