pub enum Requirement {
Required,
Optional,
}Expand description
Whether something is REQUIRED to present or answer an interaction faithfully, or merely preferred.
This is the axis ADR law 5 turns on: unknown REQUIRED behavior fails closed; unknown OPTIONAL behavior degrades visibly. Without it a consumer that cannot satisfy a demand has only one move for both cases, and whichever it picks is wrong half the time — silently dropping a mandatory secret field, or refusing a document that merely wanted a diagram.
One vocabulary, deliberately: controls and surface features both use it, so a wire consumer learns the distinction once. On a control it means “the response must answer this FIELD” — which is only coherent because a choice is one field with many options, not many fields.
Variants§
Required
Must be satisfiable. If it is not, the interaction is
Unsupported and no answer may be guessed.
Optional
Preferred. If it is not satisfiable, the interaction proceeds and the shortfall is reported visibly.