json_schema v0.2.0 JsonSchema.Parser.ObjectParser View Source

Parses a JSON schema object type:

{
  "type": "object",
  "properties": {
    "color": {
      "$ref": "#/color"
    },
    "title": {
      "type": "string"
    },
    "radius": {
      "type": "number"
    }
  },
  "required": [ "color", "radius" ]
}

Into an JsonSchema.Types.ObjectType

Link to this section Summary

Functions

Creates a property dictionary based on a type dictionary and a type path

Returns true if the json subschema represents an allOf type

Link to this section Functions

Link to this function create_property_dict(type_dict, path) View Source

Creates a property dictionary based on a type dictionary and a type path.

Examples

iex> type_dict = %{}
...> path = URI.parse("#")
...> JsonSchema.Parser.ObjectParser.create_property_dict(type_dict, path)
%{}

Parses a JSON schema object type into an JsonSchema.Types.ObjectType.

Link to this function type?(schema_node) View Source
type?(map()) :: boolean()

Returns true if the json subschema represents an allOf type.

Examples

iex> type?(%{}) false

iex> an_object = %{“properties” => %{“name” => %{“type” => “string”}}} iex> type?(an_object) true