ReadonlykindReadonlylocalReadonlymethodReadonlynameOptional ReadonlynamespacePlain contract config consumed by framework internals and integrations.
Metadata consumed by hooks, OpenAPI generation, and app conventions.
URL path template alias.
URL path template for this contract.
Response schemas keyed by HTTP status code.
Request and response schemas attached to this contract.
Server adapters use these for validation. Client and frontend integrations use them for local validation and type inference.
Attach a schema for a JSON request body.
This method is only available on POST, PUT, and PATCH contracts.
Declare route-owned application errors from an error catalog.
Catalog errors use Beignet's standard error response envelope and remain
distinguishable from framework-owned errors. Use .responses() when a
route needs a custom error response body instead of catalog semantics.
Attach a request header schema.
Multiple schemas are evaluated in declaration order and their parsed outputs are merged. This lets a contract inherit shared group headers and still declare route-specific headers.
Merge metadata into this contract.
Hooks and tooling can read metadata for concerns such as auth, rate limits, idempotency, OpenAPI, or app-specific conventions.
Merge OpenAPI operation metadata into this contract.
Attach a schema for dynamic path parameters.
The schema validates parameters parsed from path templates such as
/posts/:id or /posts/[id].
Attach a schema for query parameters.
Add or replace route-owned response schemas by status code.
These schemas describe business responses returned by route handlers. Framework-owned errors such as request validation failures do not need to be declared here.
Use null for void/empty responses such as 204 No Content.
Fluent builder for one HTTP contract.
A contract describes the transport boundary for one endpoint: method, path, request schemas, response schemas, metadata, and route-owned catalog errors. Builder methods are immutable; each call returns a new builder with narrower types.