Ash.Type.Keyword (ash v3.5.9)
View SourceRepresents a keyword list, stored as a :map
in the database.
A builtin type that can be referenced via :keyword_list
:fields
(keyword/0
) - Required. The types of the fields in the keyword, and their constraints.
If constraints are specified, only those fields will be in the casted keyword.
For example:
allow_nil? is true by defaultfields: [ amount: [ type: :integer, description: "The amount of the transaction", constraints: [ max: 10 ] ], currency: [ type: :string, allow_nil?: false, description: "The currency code of the transaction", constraints: [ max_length: 3 ] ] ]
:type
(anAsh.Type
) - Required.:description
(String.t/0
):allow_nil?
(boolean/0
) - The default value istrue
.:constraints
(keyword/0
) - The default value is[]
.