json_schema v0.1.0 JsonSchema.Types.AllOfType View Source

Represents a custom ‘all_of’ type definition in a JSON schema.

JSON Schema:

The following example schema has the path “#/definitions/fancyCircle”

{
  "allOf": [
    {
      "type": "object",
      "properties": {
        "color": {
          "$ref": "#/definitions/color"
        },
        "description": {
          "type": "string"
        }
      },
      "required": [ "color" ]
    },
    {
      "$ref": "#/definitions/circle"
    }
  ]
}

Where “#/definitions/color” resolves to:

{
  "type": "string",
  "enum": ["red", "yellow", "green"]
}

Where “#/definitions/circle” resolves to:

{
   "type": "object",
   "properties": {
     "radius": {
       "type": "number"
     }
   },
   "required": [ "radius" ]
}

Resulting Elixir representation:

%AllOfType{name: "fancyCircle",
           path: ["#", "definitions", "fancyCircle"],
           types: [["#", "definitions", "fancyCircle", "allOf", "0"],
                   ["#", "definitions", "fancyCircle", "allOf", "1"]]}

Link to this section Summary

Link to this section Types

Link to this type t() View Source
t() :: %JsonSchema.Types.AllOfType{
  name: String.t(),
  path: JsonSchema.TypePath.t(),
  types: [JsonSchema.TypePath.t()]
}

Link to this section Functions