# `JSONSchex.Types.Rule`
[🔗](https://github.com/xinz/jsonschex/blob/main/lib/jsonschex/types.ex#L46)

A single compiled validation step.

The `validator` function accepts `(data, {path, evaluated, context})` and returns
`:ok`, `{:ok, evaluated_keys}`, or `{:error, errors}`.

# `t`

```elixir
@type t() :: %JSONSchex.Types.Rule{
  name: atom(),
  params: term(),
  validator: (term(), term() -&gt; {:ok, MapSet.t()} | {:error, list()})
}
```

---

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