JsonSchema.Parser.AllOfParser (json_schema v0.6.0)

Copy Markdown View Source

Parses a JSON schema allOf type:

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

Into an JsonSchema.Types.AllOfType.

Summary

Functions

Returns true if the JSON subschema represents an allOf type.

Functions

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

Parses a JSON schema allOf type into an JsonSchema.Types.AllOfType.

type?(arg1)

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

Returns true if the JSON subschema represents an allOf type.

Examples

iex> type?(%{}) false

iex> type?(%{"allOf" => []}) false

iex> type?(%{"allOf" => [%{"$ref" => "#foo"}]}) true