Tungsten v0.1.0 Tungsten.Codegen.Type View Source
Codegen for Type
Link to this section Summary
Types
The any protocol type
The array protocol type, defines the inner type as item_type and optionally defines the minimum and maximum array length
The object protocol type, optionally defining accepted keys
The primitive protocol types for numbers, integers and booleans.
References a named protocol type
The string protocol type, optionally defining accepted values in enum
Link to this section Types
Link to this type
any_type() View Source
The any protocol type
Link to this type
array_type()
View Source
array_type()
View Source
array_type() :: %Tungsten.Codegen.Type{
domain: Tungsten.Codegen.Domain.t(),
enum: term(),
item_type:
reference_type()
| primitive_type()
| string_type()
| object_type()
| any_type(),
max_items: pos_integer() | nil,
min_items: non_neg_integer() | nil,
properties: term(),
refers_to: term(),
spec: map(),
type: :array
}
array_type() :: %Tungsten.Codegen.Type{
domain: Tungsten.Codegen.Domain.t(),
enum: term(),
item_type:
reference_type()
| primitive_type()
| string_type()
| object_type()
| any_type(),
max_items: pos_integer() | nil,
min_items: non_neg_integer() | nil,
properties: term(),
refers_to: term(),
spec: map(),
type: :array
}
The array protocol type, defines the inner type as item_type and optionally defines the minimum and maximum array length
Link to this type
object_type()
View Source
object_type()
View Source
object_type() :: %Tungsten.Codegen.Type{
domain: Tungsten.Codegen.Domain.t(),
enum: term(),
item_type: term(),
max_items: term(),
min_items: term(),
properties: [Tungsten.Codegen.Property.t(), ...] | nil,
refers_to: term(),
spec: map(),
type: :object
}
object_type() :: %Tungsten.Codegen.Type{
domain: Tungsten.Codegen.Domain.t(),
enum: term(),
item_type: term(),
max_items: term(),
min_items: term(),
properties: [Tungsten.Codegen.Property.t(), ...] | nil,
refers_to: term(),
spec: map(),
type: :object
}
The object protocol type, optionally defining accepted keys
Link to this type
primitive_type() View Source
The primitive protocol types for numbers, integers and booleans.
Link to this type
reference_type() View Source
References a named protocol type
Link to this type
string_type() View Source
The string protocol type, optionally defining accepted values in enum
Link to this type
t()
View Source
t()
View Source
t() ::
any_type()
| primitive_type()
| reference_type()
| string_type()
| object_type()
| array_type()
t() :: any_type() | primitive_type() | reference_type() | string_type() | object_type() | array_type()
Link to this section Functions
Link to this function
from_spec(spec, domain)
View Source
from_spec(spec, domain)
View Source
from_spec(map(), Tungsten.Codegen.Domain.t()) :: t()
from_spec(map(), Tungsten.Codegen.Domain.t()) :: t()
Link to this function
simplify(spec)
View Source
simplify(spec)
View Source
simplify(Tungsten.Codegen.Type.t() | Tungsten.Codegen.Property.t()) :: struct()
simplify(Tungsten.Codegen.Type.t() | Tungsten.Codegen.Property.t()) :: struct()