# `JsonSchema.Types.ConstType`
[🔗](https://github.com/dragonwasrobot/json_schema/blob/0.6.0/lib/types/const_type.ex#L1)

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}}

# `t`

```elixir
@type t() :: %JsonSchema.Types.ConstType{
  const: value(),
  description: String.t() | nil,
  name: String.t() | :anonymous,
  path: URI.t(),
  type: value_type()
}
```

# `value`

```elixir
@type value() :: nil | boolean() | integer() | number() | String.t() | map() | list()
```

# `value_type`

```elixir
@type value_type() ::
  :null | :boolean | :integer | :number | :string | :object | :array
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
