Get Started
Zeta has OpenAPI docs built-in. Just make sure you've added a "schema adapter" to your top-level app. The adapter tells Zeta how to convert input/output models to JSON schemas.
By default, Zeta serves your OpenAPI spec at /openapi.json and the Scalar API Reference at /scalar.
In your top-level app, you can configure these endpoints:
;
3000;
To configure the scalar UI, pass config into the top-level app's scalar option:
;
This option is untyped, so refer to Scalar's documentation for available options.
By default, the OpenAPI spec Zeta generates does not add any models to the components.schemas section of the spec. This can lead to duplicate object schemas.
You can move models to the components.schemas section and use $ref by adding the ref metadata to your model:
;
;
"/api/users/:id",
,
,
;
You can add references to objects, enums, strings, arrays, etc. Any schema you define can have a reference, not just objects.
TIP
All validation libraries support metadata, refer to your library's docs for more information.
Response descriptions default to the HTTP status's text (e.g., "OK" for 200).
You can override this per-response by adding the responseDescription metadata to your model:
;
"/api/users/:id",
,
,
;
TIP
All validation libraries support metadata, refer to your library's docs for more information.