View Source Ash.Type.Keyword (ash v3.4.42)

Represents 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:
    fields:  [
      amount: [
        type: :integer,
        constraints: [
          max: 10
        ]
      ],
      currency: [
        type: :string,
        allow_nil?: false,
        constraints: [
          max_length: 3
        ]
      ]
    ]  
    allow_nil? is true by default
    • :type (an Ash.Type) - Required.

    • :allow_nil? (boolean/0) - The default value is true.

    • :constraints (keyword/0) - The default value is [].

Summary

Functions