Get Started
Zeta supports any Standard Schema-compatible validation library.
Zeta requires a validation library when defining routes. You need to provide a "schema adapter" to your top-level app to inform Zeta about which library you're using.
The adapter is responsible for converting schemas to JSON schemas and getting metadata about each schema.
There are two types of validation errors: input validation and output validation.
When a client makes a request, Zeta will validate the inputs (body, query, and path params).
If the request is not valid, Zeta will respond with a 400 Bad Request.
Zeta's type-system will help ensure you're returning valid response bodies from each request. But if there's a type error or you're getting unexpected data from an external source, you can still return an invalid response.
In these cases, Zeta will respond with a 422 Unprocessable Entity, indicating the server tried to return an invalid response.
Zod is a peer dependency, so you need to install it separately.
;
;
;
3000;
Create your own adapter implementing the SchemaAdapter interface. Refer to Zod's implementation as an example.
You need to implement 3 functions:
toJsonSchema returns a JSON schema representation of the given schema.parseParamsRecord converts an object definition used for path and query parameters to path/query parameter definitions.getMeta returns metadata about the given schema.