Zoi is a new Elixir schema validation library inspired by TypeScript's Zod, bringing similar ergonomics to the Elixir ecosystem. It enables declarative schema definition, runtime validation, typespec inference for Dialyzer, and automatic JSON Schema generation for OpenAPI documentation. The library integrates with Phoenix controllers and LiveView forms, supports metadata-driven documentation, and complements existing tools like Ecto and NimbleOptions while maintaining validation and documentation in sync.
Table of contents
What is Zod?The Birth of ZoiThe Elixir EcosystemValidate External Payloads EarlyZoi and Type SpecsWorking With Phoenix FormsDocumentation, Metadata, and JSON SchemaShould You Use Zoi?Further ReadingSort: