Skip to content

Schema Design

Prefer explicit id values for every field and report. Labels are user-facing copy; ids are integration contracts.

{
id: "customer_age",
kind: "number",
label: "Customer age",
min: 0,
max: 120
}

Guidelines:

TopicRecommendation
IdsUse stable snake case or kebab case. Do not derive backend contracts from labels.
LabelsWrite labels for users, not for machines.
RequiredUse required for user obligations, not backend convenience.
DefaultsUse defaultValue for schema-owned defaults and initialValues for session data.
UI metadataPut renderer-specific hints in ui; do not make the backend depend on them.
VersioningVersion schemas at your API boundary when models change required inputs.

Avoid changing field ids after a backend is deployed. If a model changes, add a new field id and migrate deliberately.