What problem does it solve?
Effect Schema enables type-safe runtime validation and bidirectional data transformation for Effect-based applications, reducing runtime errors when consuming external data and ensuring consistent data shapes across boundaries.
Core Features & Use Cases
- Type-safe runtime validation with TypeScript inference.
- Bidirectional decoding and encoding between external payloads and internal types.
- Class-based and tagged schemas for ergonomic modeling and exhaustive matching.
- JSON Schema interoperability and utilities like Schema.parseJson for safe JSON parsing.
- Rich, customizable error messages and annotation support for self-documenting schemas.
- Seamless error handling with Effect integration and typed errors.
Quick Start
Validate a JSON payload against a simple Schema.Struct({ id: Schema.Number, name: Schema.String }) and decode it into a typed object using Schema.decodeUnknownSync, returning either the typed value or a ParseError.