Explicit field type restrictions and RFC revision (RFC 9651 Section 2).
new/1 requires a map containing :revision (:rfc8941 or :rfc9651),
:type (:item, :list, or :dictionary), and nonempty :item_types.
Bare types are :integer, :decimal, :string, :token, :bytes, and
:boolean; RFC 9651 additionally allows :date and :display_string.
:inner_lists defaults to false. :parameter_types defaults to all types
in the selected revision. These restrictions apply to every item, including
inner-list items, and every parameter, respectively. Unknown options reject.
This is a type schema, not a complete field protocol or profile. The caller selects it from the field's normative specification and checks any additional semantic rules. No field name or recognized syntax selects a newer revision. Directly constructed schemas undergo the same validation at each entry point.
Summary
Functions
Construct an explicit type schema; no revision or item-type defaults.
Types defined by the selected revision; invalid revisions return an empty list.
Validate revision, top-level type, and all bare-type restrictions.
Types
@type bare_type() ::
:integer
| :decimal
| :string
| :token
| :bytes
| :boolean
| :date
| :display_string
Functions
@spec new(map()) :: {:ok, t()} | {:error, RequestSeal.StructuredFields.Error.t()}
Construct an explicit type schema; no revision or item-type defaults.
Types defined by the selected revision; invalid revisions return an empty list.
@spec validate(term()) :: :ok | {:error, RequestSeal.StructuredFields.Error.t()}
Validate revision, top-level type, and all bare-type restrictions.