2026-05-18 - OpenAPI Try It Proxy¶
Motivation¶
The API Reference page loaded the deployed elb-openapi specification, but the embedded Try It controls called /api/aks/openapi/proxy, which the FastAPI sidecar did not implement. In the deployed Container App this fell through to the frontend catch-all and returned 404 unknown api route.
User-facing change¶
- Try It requests on
/docsnow route through the authenticated API sidecar to the runningelb-openapiLoadBalancer service. - The proxy returns a structured retryable
503when the OpenAPI service IP is not available yet. - Browser bearer tokens are not forwarded to the OpenAPI pod; only request headers needed for content negotiation are passed through.
API / IaC diff summary¶
- Added
GET|POST|PUT|PATCH|DELETE /api/aks/openapi/proxyon the existing AKS router. - The route resolves the
elb-openapiservice IP through the direct Kubernetes API helper and forwards the request path to that service. - Added regression tests for successful forwarding, missing service IP handling, invalid path rejection, and auth gating.
- No IaC changes.
Validation evidence¶
uv run ruff check api/routes/stubs.py api/tests/test_openapi_proxy_route.py api/tests/test_smoke.pyuv run pytest -q api/tests/test_openapi_proxy_route.py api/tests/test_smoke.py-> 49 passeduv run pytest -q api/tests-> 626 passedscripts/dev/quick-deploy.sh apiwith explicit target env -> deployedelb-api:20260518155822toapi,worker, andbeatonca-elb-control.curl https://ca-elb-control.gentlemeadow-01289e5b.koreacentral.azurecontainerapps.io/api/health-> 200 from revisionca-elb-control--0000055.- Anonymous
curlto/api/aks/openapi/proxy?...&path=%2Fhealthz-> 401missing bearer token, proving the deployed route is registered and no longer falls through to404 unknown api route.