# featurevisor_schemas v2.1.0 - API Reference

## Modules

- [FeaturevisorSchemas](FeaturevisorSchemas.md): Validates data against the schemas a Featurevisor datafile carries, with the
same rules, messages and conditions as `@featurevisor/schemas` in JavaScript.
- [FeaturevisorSchemas.CheckInfo](FeaturevisorSchemas.CheckInfo.md): What a check in code gets besides the value at its path: the whole input and the context.
- [FeaturevisorSchemas.Constraints](FeaturevisorSchemas.Constraints.md): The HTML validation attributes a field's rules imply, nil where the rules set none.
- [FeaturevisorSchemas.Handle](FeaturevisorSchemas.Handle.md): A schema's handle, or a field's. Everything it does reads the current
datafile when it is used, so one handle stays right for the life of an
application. A handle is a plain term, safe to keep and share.

- [FeaturevisorSchemas.Issue](FeaturevisorSchemas.Issue.md): One problem with a value, with what an application needs to word it.
- [FeaturevisorSchemas.MessageInfo](FeaturevisorSchemas.MessageInfo.md): What a message function and a translator get besides the issue: the context validation uses.
- [FeaturevisorSchemas.Option](FeaturevisorSchemas.Option.md): A choice a field allows: its value, its title when the schema or a source
gives one, and every field said about it, the value included.

- [FeaturevisorSchemas.OptionSource](FeaturevisorSchemas.OptionSource.md): Choices for a field that come from the application, such as cities from a
service. `search` gets a query and returns `{:ok, choices}`, each a value or
a map with a `"value"`. `lookup` gets a value and returns `{:ok, fields}` for
the choice it finds, `:error` for none, which reports `enum`, or
`{:error, reason}` when it cannot tell, which reports `refineError`.

- [FeaturevisorSchemas.Refinement](FeaturevisorSchemas.Refinement.md): A check in code that rules cannot express, such as whether a username is
taken. `check` gets the value at `path` and a `FeaturevisorSchemas.CheckInfo`,
and returns true when the value passes, false when it does not, or
`{:error, reason}` when it cannot tell. It runs after the rules, and only
where they found no issue at or inside its path, nor in a field it `reads`.
A check that errors, raises or exits reports `refineError`.

- Exceptions
  - [FeaturevisorSchemas.ValidationError](FeaturevisorSchemas.ValidationError.md): Raised by `FeaturevisorSchemas.validate!/4` when a value fails, with the issues found.

