Per-field validation rules (min/max, length, regex) for field definitions #11

Open
opened 2026-06-02 08:47:08 +00:00 by logaritmisk · 0 comments
Owner

Spec §6.2 lists "validation rules" as part of a field definition. The MVP registry (crates/db/migrations/0004_field_definition.sql, domain::FieldDefinition) ships type + required + vocabulary/authority binding only — no general per-field rules (numeric min/max, string length, regex/pattern, allowed-range for dates, etc.).

Plan 5 (object JSONB values + validation) will validate values against type + required + binding as-is. If/when richer rules are wanted, add them as an additive migration (a rules column or a field_definition_rule table) plus a validation step — FieldType-orthogonal, so it layers on without disturbing the registry's shape.

Source: Plan 4 (field-definition registry) final review — deliberate MVP scope cut, recorded for later.

Spec §6.2 lists "validation rules" as part of a field definition. The MVP registry (`crates/db/migrations/0004_field_definition.sql`, `domain::FieldDefinition`) ships **type + `required` + vocabulary/authority binding** only — no general per-field rules (numeric min/max, string length, regex/pattern, allowed-range for dates, etc.). Plan 5 (object JSONB values + validation) will validate values against **type + required + binding** as-is. If/when richer rules are wanted, add them as an additive migration (a rules column or a `field_definition_rule` table) plus a validation step — `FieldType`-orthogonal, so it layers on without disturbing the registry's shape. _Source: Plan 4 (field-definition registry) final review — deliberate MVP scope cut, recorded for later._
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: logaritmisk/biggus-dickus#11