EndpointSpec for general endpoints and JSONEndpointSpec for typed JSON endpoints. The fields on these specs are the policy the runtime executes—not documentation-only annotations.
Declare the complete endpoint
Respond, which returns a *response.Res. Handler remains available for integrations that render directly onto the request.
Expect the runtime to finish some requests
The handler runs only after the relevant boundary checks pass. The runtime can complete a request because of:- the wrong method or media type;
- an oversized or unreadable body;
- failed authentication, caller access, or endpoint controls;
- invalid request metadata or response projection;
- an idempotency conflict or unavailable store; or
- an expired handler timeout.
net/http behavior.
Give every operation a stable identity
Operation.ID connects the endpoint to generated documents, endpoint catalogs, completion events, availability controls, and cost accounting. Keep it stable across route changes.
Declare Operation.Kind explicitly as read or write. HTTPAPI does not infer mutation from the HTTP method, and groups do not supply a default kind.