View Source JsonSchema.Parser.PrimitiveParser (json_schema v0.5.0)
Parses a JSON schema primitive type:
{
"description": "A name",
"default": "Steve",
"type": "string"
}Into an JsonSchema.Types.PrimitiveType.
Link to this section Summary
Functions
Parses a JSON schema primitive type into an JsonSchema.Types.PrimitiveType.
Returns true if the json subschema represents a primitive type.
Link to this section Functions
@spec parse(JsonSchema.Types.schemaNode(), URI.t(), URI.t(), URI.t(), String.t()) :: JsonSchema.Parser.ParserResult.t()
Parses a JSON schema primitive type into an JsonSchema.Types.PrimitiveType.
@spec type?(JsonSchema.Types.schemaNode()) :: boolean()
Returns true if the json subschema represents a primitive type.
examples
Examples
iex> type?(%{}) false
iex> type?(%{"type" => "object"}) false
iex> type?(%{"type" => "boolean"}) true
iex> type?(%{"type" => "integer"}) true