# Schema validation

<PageBadges />

form0-core validates schemas before running the engine. Validation focuses on structure and
attribute correctness, not UI concerns.

## What is validated

- Required attributes per field type
- Allowed values for attributes (for example, `display` options)
- Unique `key` and `data_name`
- `data_name` format (lowercase a-z, 0-9, underscore, max length 42)
- Default values match field type rules
- Condition operators are valid for the referenced field type
- AI metadata shape and allowed keys

## Runtime validation

At runtime, fields also validate their values when the engine evaluates:

- Numeric min/max checks
- Pattern matches for text fields
- Choice values must match defined choices

## Typical errors

- Missing required attributes
- Duplicate `key` or `data_name`
- Invalid operators (for example, `contains` on a numeric field)
- Default values that do not match the field type
