Features
A primer on what this runtime implementation supports, with normative references to the standards each feature implements. Citations point at the canonical specification rather than secondary sources.
Client & Server
- HTTP/1.1 and HTTP/2 over plaintext or TLS. HTTP/2 is inherited
transparently from Go’s
net/httpstack on both client and server when ALPN negotiatesh2; no runtime-specific wiring. See HTTP core below for the supporting RFCs. - Content negotiation on
Accept/Accept-Encoding, honouring MIME parameters and quality values (RFC 9110 ยง12, ยง12.4.2 quality values). - URI templating for path-parameter expansion (Level-1 simple expansion only) per RFC 6570; values are percent-encoded per RFC 3986 ยง2.
- Structured-suffix MIME matching โ e.g.
application/vnd.acme+jsonfalls back to theapplication/jsoncodec (RFC 6838 ยง4.2.8, IANA structured-syntax-suffix registry). - Routing against an analyzed OpenAPI specification.
- Predefined codecs:
Format Reference JSON RFC 8259 XML W3C XML 1.0 (via Go encoding/xml)CSV RFC 4180 text/plainRFC 2046 ยง4.1 Byte stream application/octet-streamโ RFC 2046 ยง4.5.1YAML YAML 1.2 (via the yamlpcsub-package) - Parameter binding for every OpenAPI parameter location:
- Path parameters with URI Template Level-1 expansion (RFC 6570).
- Query parameters.
- Header parameters.
- Request body decoded through the matched
Consumer.
- Streaming bodies:
- File upload via
multipart/form-data(RFC 7578) orapplication/x-www-form-urlencoded(WHATWG URL). - Other streams via
application/octet-stream(RFC 2046 ยง4.5.1) or any custom MIME, surfaced asio.Reader/io.Writer.
- File upload via
Trailing-slash behaviour
- Strictly preserved by the client โ the path supplied by the caller is passed through verbatim.
- Ignored by the server โ a route declared as
/petsmatches both/petsand/pets/.
Optional, opt-in
- Loosened content negotiation (
negotiate.WithIgnoreParameters):- Strip MIME parameters before matching
(
application/json; charset=utf-8โapplication/json). - Match the structured MIME suffix
(
application/vnd.acme+jsonโapplication/json).
- Strip MIME parameters before matching
(
Client
- Configurable HTTP transport, TLS / mTLS (RFC 8446), proxy support per RFC 9110 ยง7.6.4.
- Pluggable authentication writers (see Authentication).
- Built-in OpenTelemetry tracing (OpenTelemetry spec); legacy OpenTracing support remains in a sibling compatibility module.
- Debug mode โ request / response dumping enabled via the
Runtime.Debugfield (orRuntime.SetDebug(true)); useful while iterating on a generated client.
Server
- Composable middleware pipeline: Router โ Security โ Bind โ Validate โ OperationHandler โ Responder.
- Pluggable error rendering via
api.ServeError. - Built-in doc-UI middleware: SwaggerUI, RapiDoc, Redoc.
Authentication schemes
The runtime parses the standard auth headers and dispatches to application-supplied callbacks for credential / token validation. Token issuance, JWT signature checking, and OIDC ID-token validation are out of scope โ they belong in the callback.
- HTTP Basic โ header parsing per RFC 7617.
- API Key in header, query, or cookie โ OpenAPI security scheme convention; no dedicated RFC.
- Bearer tokens โ header parsing per RFC 6750. The runtime treats the bearer value as an opaque string; downstream parsing (JWT, opaque tokens, โฆ) is the callback’s responsibility.
- OAuth 2.0 โ the runtime exposes the same Bearer hook with the OAuth-2 framing (RFC 6749; RFC 8252 for native apps). All four grant flows (authorization code, implicit, client credentials, password) work because the runtime sees only the resulting access token.
Not supported (yet)
- Language negotiation โ
Accept-Language/Content-Languageheaders and language-tag parsing. - Compression โ
Accept-Encoding/Content-Encodingnegotiation and the content-coding registry (gzip, Brotli, zstd). - HTTP caching โ
Cache-Control/ETag/Last-Modified/ validators.
Normative references
OpenAPI specifications
- OpenAPI v2 (Swagger 2.0) โ the dialect this runtime targets.
HTTP core
- RFC 9110 โ HTTP Semantics (supersedes RFC 7230-7235).
- RFC 9111 โ HTTP Caching.
- RFC 9112 โ HTTP/1.1.
- RFC 9113 โ HTTP/2.
- RFC 8446 โ TLS 1.3 ยท RFC 5246 โ TLS 1.2.
URIs
Media types
- RFC 6838 โ Media Type Specifications and Registration (structured-syntax suffixes in ยง4.2.8).
- IANA structured-syntax-suffix registry.
- RFC 8259 โ JSON.
- W3C XML 1.0 (5th ed.).
- RFC 4180 โ CSV.
- YAML 1.2.
- RFC 7578 โ
multipart/form-data. - WHATWG URL โ
application/x-www-form-urlencoded.
Authentication
- RFC 7617 โ HTTP Basic.
- RFC 6749 โ OAuth 2.0 Authorization Framework.
- RFC 6750 โ OAuth 2.0 Bearer Token Usage.
- RFC 8252 โ OAuth 2.0 for Native Apps.