Repository navigation
Description
Context
Follow-up to #2113 / PR #2128. Stages 1-2 of that work (merged) established:
options.specs.<name>.serveris a singular, connection-only override that exists solely onserver/client-kind bindings (binding-openapi,binding-asyncapi) — never onproxy-kind bindings, which hold no real connection.when.servers/when.tagare pure, portable route-selection conditions that match against each spec's own literal declared values (OpenapiServerView.literalUrl/AsyncapiServerView.literalHost/literalUrl), decoupled from whatever deployment override is configured — available uniformly across server, client, and proxy kinds.
This closed the abstraction leak in options.* and route-condition config. What remains out of scope for that PR is the deeper, runtime-stream-handler-level leak identified during design discussion:
In the pipeline openapi server -> openapi-asyncapi proxy -> asyncapi client (and symmetrically for openapi client, and for asyncapi server/client/proxy), when openapi server has options.specs.*.server configured for a spec with a path prefix, the decoded HTTP request carries the connection-oriented :scheme/:authority/:path (including that path prefix) as an embedded OpenapiBeginEx → HttpBeginEx extension. openapi-asyncapi then needs to route via the generated http_kafka_proxy0 composite binding, whose when.path conditions are baked in path-prefix-aware at generation time. Today this works only because openapi-asyncapi (incorrectly, per Stages 1-2) held its own copy of the connecting binding's server config to reconstruct the same path shape — an abstraction leak, since openapi-asyncapi already has the canonical apiId/operationId and shouldn't need to know anything about how the connecting binding chose to serve requests.
Proposal
Canonicalize the request (strip the deployment-specific server/path shape down to the spec's own canonical form) on the way in at OpenapiServerFactory/AsyncapiServerFactory, and un-canonicalize (reapply the configured server's shape) on the way out at OpenapiClientFactory/AsyncapiClientFactory. Everything in between — openapi-asyncapi proxy, asyncapi proxy (mqtt-kafka/sse-kafka/http-kafka mapping) — would then operate purely in canonical terms (apiId/operationId), with no need to reference options.specs.*.server at all, closing the leak completely.
This is real-time stream-handler work (not just config generation), materially riskier than Stages 1-2, and depends on Stages 1-2 already being in place (a clean, singular server override to canonicalize against). It was deferred from #2128 for that reason.
Scope
OpenapiServerFactory/OpenapiClientFactory(runtime/binding-openapi)AsyncapiServerFactory/AsyncapiClientFactory(runtime/binding-asyncapi)- Verify
openapi-asyncapi's generatedhttp_kafka_proxy0routing andasyncapiproxy's mqtt-kafka/sse-kafka/http-kafka mapping no longer need any server-shaped config once canonicalization is in place.
Activity
refactor(common-asyncapi): drop vestigial server-index from AsyncapiC…
feat(binding-openapi): un-canonicalize response Location header at se…
feat(binding-asyncapi): un-canonicalize response Location header at s…
Canonicalize/un-canonicalize request path at server/client stream-fac…