Typed endpoint contracts
Declare methods, paths, access, idempotency, priorities, timeouts, request limits, accounting and backend routing together instead of scattering policy through middleware and side tables.
A shared contract for typed HTTP services.
The project
HTTPAPI defines the behavior of a typed HTTP service independently of the language or framework used to implement it. The contract covers routing, request metadata, response envelopes, projections and structured errors.
The Go package is the reference implementation, not the boundary of the idea. The published specification exists so another runtime can implement the same observable semantics and interoperate without copying Go internals.
The Go package
HTTPAPI is a composable layer around Go's standard net/http stack. It keeps transport policy, typed request parsing, response construction and machine-readable API descriptions in one contract while leaving databases, authentication providers, logging and deployment infrastructure to the application.
v0.1.0net/httpDeclare methods, paths, access, idempotency, priorities, timeouts, request limits, accounting and backend routing together instead of scattering policy through middleware and side tables.
Turn JSON into domain-ready Go values with required and optional parameters, enums, mutually exclusive fields, discriminated objects and caller-aware availability—without a second validation pass.
Validate pick and omit paths against typed response shapes before the handler runs. Handlers can skip optional reads, and omitted attribute getters are never evaluated during response construction.
Use named callers and directional projection policies to control endpoint, parameter and response-attribute availability without treating callers as a numeric privilege ladder.
Parsing, projection and runtime failures carry machine-readable identities that services can place inside their own public error envelope.
Generate OpenAPI 3.1 and GCP API Gateway documents from the same provider-neutral endpoint and response metadata enforced at runtime.
What it owns
Public behavior is specified before it becomes a convenience of one server framework or generated client.
Callers can request valid projections while handlers avoid computing response properties that will not be returned.
Parsing, validation and application failures have stable machine-readable identities instead of ad hoc response bodies.
We use optional analytics and advertising cookies to understand visits and measure campaigns. Read our privacy policy.