# `OpenUI.Runtime.Validation`
[🔗](https://github.com/ideia4it/openui/blob/v0.1.1/lib/openui/runtime/validation.ex#L1)

Field validation rules (language.md, section 5.4): `required`, `email`,
`url`, `numeric`, `minLength`, `maxLength`, `min`, `max` and `pattern`.

Rules run in that fixed order, since an evaluated rules object carries no
key order, and the first failing rule names the error. Every rule except
`required` skips empty values. Unknown rules are ignored.

# `validate`

```elixir
@spec validate(term(), map()) :: :ok | {:error, String.t()}
```

Checks `value` against `rules`; returns `{:error, rule}` for the first rule that fails.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
