cadrumo.core.requirement module

Whether something must be supplied or may be omitted.

A two-member modality that five surfaces had each declared for themselves: profile keys before declaration export, manual casilla entry, diagnostic findings, the CLI’s repair findings, and a diagnostics helper’s parameter. The subject differs at every one of them; the question does not.

Deliberately generic and deliberately not a bool. A boolean field named required reads the same in a payload whether it was set or defaulted, and it cannot grow a third member. The vocabularies that DO need a third member – an unknown, a not-applicable, a zero-by-law – are separate types and must stay separate; this one is for the surfaces where the answer is genuinely one of two.

class Requirement(*values)[source]

Bases: StrEnum

Whether a value must be supplied.

REQUIRED

Must be supplied; its absence is a defect the surface reports.

OPTIONAL

May be omitted, and its absence is not by itself a finding.

RequirementValue

The same vocabulary for a strict model field or payload surface.

A bare enum under strict validation refuses the plain token a serialised finding carries, so those fields take this literal over the members above rather than restating the pair.

alias of Literal[REQUIRED, OPTIONAL]