View Source JsonSchema.Types.AllOfType (json_schema v0.5.0)

Represents a custom allOf type definition in a JSON schema.

JSON Schema:

The following example schema has the path "#/definitions/fancyCircle"

{
  "description": "A fancy circle",
  "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"]
}

and "#/definitions/circle" resolves to:

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

Resulting in the Elixir representation:

%AllOfType{name: "fancyCircle",
           description: "A fancy circle",
           path: URI.parse("#/definitions/fancyCircle"),
           types: [URI.parse("#/definitions/fancyCircle/allOf/0"),
                   URI.parse("#/definitions/fancyCircle/allOf/1")]}

Link to this section Summary

Link to this section Types

@type t() :: %JsonSchema.Types.AllOfType{
  default: JsonSchema.Types.json_value(),
  description: String.t() | nil,
  name: String.t() | :anonymous,
  path: URI.t(),
  types: [URI.t()]
}