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

Represents a custom union type definition in a JSON schema.

JSON Schema:

"favoriteNumber": {
  "description": "Your favorite number",
  "type": ["number", "integer", "null"]
}

Resulting in the Elixir representation:

%UnionType{name: "favoriteNumber",
           description: "Your favorite number",
           path: URI.parse("#/favoriteNumber"),
           types: [:number, :integer, :null]}

Link to this section Summary

Link to this section Types

@type default_value() :: nil | boolean() | integer() | float() | binary()
@type t() :: %JsonSchema.Types.UnionType{
  default: default_value(),
  description: String.t() | nil,
  name: String.t() | :anonymous,
  path: URI.t(),
  types: [value_type()]
}
@type value_type() :: :null | :boolean | :integer | :number | :string