json_schema v0.3.0 JsonSchema.Types.EnumType View Source

Represents a custom enum type definition in a JSON schema.

JSON Schema:

"color": {
  "description": "A set of colors",
  "type": "string",
  "enum": ["none", "green", "orange", "blue", "yellow", "red"]
}

Resulting in the Elixir representation:

%EnumType{name: "color",
          description: "A set of colors",
          path: URI.parse("#/color"),
          type: "string",
          values: ["none", "green", "orange",
                   "blue", "yellow", "red"]}

Link to this section Summary

Link to this section Types

Link to this type

t()

View Source
t() :: %JsonSchema.Types.EnumType{
  description: (String.t() | nil) | nil,
  name: String.t(),
  path: URI.t(),
  type: (String.t() | nil) | nil,
  values: [String.t() | number() | nil]
}