ProjectsProtocol

HTTPAPI

A shared contract for typed HTTP services.

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.

A complete contract layer for Go services.

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.

Supported Go
Go 1.27+
Package release
v0.1.0
Specification
HTTPAPI 0.2
Runtime foundation
net/http
01

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.

02

Parse once

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.

03

Projection before work

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.

04

Caller-aware responses

Use named callers and directional projection policies to control endpoint, parameter and response-attribute availability without treating callers as a numeric privilege ladder.

05

Stable failure semantics

Parsing, projection and runtime failures carry machine-readable identities that services can place inside their own public error envelope.

06

Contract transcription

Generate OpenAPI 3.1 and GCP API Gateway documents from the same provider-neutral endpoint and response metadata enforced at runtime.

01

Contract before runtime

Public behavior is specified before it becomes a convenience of one server framework or generated client.

02

Selective responses

Callers can request valid projections while handlers avoid computing response properties that will not be returned.

03

Errors with meaning

Parsing, validation and application failures have stable machine-readable identities instead of ad hoc response bodies.

04 / Read, inspect, contribute

Follow the work.

Optional cookies

We use optional analytics and advertising cookies to understand visits and measure campaigns. Read our privacy policy.