View Source JsonSchema.Types.AnyOfType (json_schema v0.5.0)
Represents a custom anyOf
type definition in a JSON schema.
JSON Schema:
The following example schema has the path "#/definitions/fancyCircle"
{
"description": "A fancy circle",
"anyOf": [
{
"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:
%AnyOfType{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.AnyOfType{ default: JsonSchema.Types.json_value(), description: String.t() | nil, name: String.t() | :anonymous, path: URI.t(), types: [URI.t()] }