json_schema v0.3.0 JsonSchema.Parser.ErrorUtil View Source

Contains helper functions for reporting parser errors.

Link to this section Summary

Link to this section Functions

Link to this function

get_type(value)

View Source
get_type(any()) :: String.t()

Returns the name of the type of the given value.

Examples

iex> get_type([1,2,3])
"list"

iex> get_type(%{"type" => "string"})
"object"

iex> get_type("name")
"string"

iex> get_type(42)
"integer"
Link to this function

invalid_type(identifier, property, expected_type, actual_value)

View Source
Link to this function

unknown_enum_type(type_name)

View Source
unknown_enum_type(String.t()) :: JsonSchema.Parser.ParserError.t()
Link to this function

unknown_primitive_type(type_name)

View Source
unknown_primitive_type(String.t()) :: JsonSchema.Parser.ParserError.t()
Link to this function

unresolved_reference(identifier, parent)

View Source
Link to this function

unsupported_schema_version(supplied_value, supported_versions)

View Source
unsupported_schema_version(String.t(), [String.t()]) ::
  JsonSchema.Parser.ParserError.t()