json_schema v0.3.0 JsonSchema.Types.ConstType View Source

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

Link to this type

t()

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