A Zod-inspired schema builder for runtime value parsing and validation in Go, featuring a concise API and zero dependencies.
Zog is a schema builder for runtime value parsing and validation in Go, inspired by Zod and Yup. It allows developers to define expressive schemas to validate, parse, and transform data, handling everything from simple types to complex interdependent validations. The library solves the problem of ensuring data integrity and structure in Go applications with a clean, chainable API.
Go developers who need robust data validation and parsing for APIs, forms, JSON, or environment variables, especially those familiar with Zod or Yup from other ecosystems.
Developers choose Zog for its Zod-like API that feels familiar and expressive, its high performance compared to other Go validation libraries, and its zero-dependency design that keeps projects lightweight. The included helper packages for common use cases like HTTP and JSON parsing provide immediate utility without extra setup.
Go with Zod inspired simple schema validation
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a chainable, type-safe schema building interface inspired by Zod, making it intuitive for developers familiar with JavaScript/TypeScript ecosystems.
Benchmarked as one of the fastest Go validation libraries, closely trailing goplayground/validator, ensuring efficient runtime validation.
Allows adding custom tests and schemas, enabling complex, project-specific validation rules beyond built-in types.
Provides detailed error context with specific field and rule information, simplifying debugging and troubleshooting.
Includes packages like zenv for environment variables and zhttp for HTTP data, reducing boilerplate for parsing common data sources.
Still in version 0 with breaking changes possible in minor versions, as noted in the README, posing risks for production stability.
Discourages creating custom data providers due to potential API changes, limiting flexibility for unconventional data sources.
Fields are optional by default in struct schemas, which can lead to unintended behavior if developers forget to mark them as required.
Struct generation from schemas is listed in the roadmap but not yet implemented, requiring manual mapping for some use cases.