Normalizes schema declarations and validates decoded structured data.
The validator intentionally supports a small but extensible surface:
- Function schemas – a single-arity validator function
- Module schemas – modules that export
validate/1,cast/1,from_map/1, orchangeset/2 - Map schemas –
%{required: [...], optional: [...]}helpers or maps that enumerate fields - List schemas – treated as a list of required keys
When no schema is provided, the decoded value is returned verbatim.
Summary
Functions
Validates the decoded payload against the supplied schema.