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

Represents a custom const type definition in a JSON schema.

JSON Schema:

"favoriteNumber": {
  "type": "integer",
  "const": 42
}

or

"testStruct": {
  "const": {
    "name": "Test",
    "foo": 43
  }
}

Resulting in the Elixir representation:

%ConstType{name: "favoriteNumber",
           description: nil,
           type: :number,
           path: URI.parse("#/favoriteNumber"),
           const: 42}

or

%ConstType{name: "testStruct",
           description: nil,
           type: :object,
           path: URI.parse("#/testStruct"),
           const: %{"name" => "Test", "foo" => 43}}

Link to this section Summary

Link to this section Types

@type t() :: %JsonSchema.Types.ConstType{
  const: value(),
  description: String.t() | nil,
  name: String.t() | :anonymous,
  path: URI.t(),
  type: value_type()
}
@type value() :: nil | boolean() | integer() | number() | String.t() | map() | list()
@type value_type() ::
  :null | :boolean | :integer | :number | :string | :object | :array