1 lien privé
I work with Elixir daily, and while it has great libraries like Ecto and Phoenix Framework, one thing kept bothering me: there wasn’t a library that felt like Zod. Elixir has alternatives for data validation, but none gave me the same ergonomics. This article walks through that gap, how Zoi came to be, and where it fits.
What is Zod?
Zod is a TypeScript-first schema declaration and validation library that allows developers to define schemas for their data and validate them at runtime. It also provides type inference, which means that the types of the data are automatically inferred from the schema. Zod also provides a way to generate JSON Schema from the defined schemas, making it easier to integrate with other tools and libraries such as OpenAPI which is widely used for API documentation.