Generate the Go SDK API clients with upstream oapi-codegen - #70962
Closed
jason810496 wants to merge 1 commit into
Closed
Generate the Go SDK API clients with upstream oapi-codegen#70962jason810496 wants to merge 1 commit into
jason810496 wants to merge 1 commit into
Conversation
The Go SDK's Execution API and Edge worker API clients were generated by a bespoke resty-based code generator and used resty.dev/v3 as their HTTP client. Regenerate both clients with the upstream github.com/oapi-codegen/oapi-codegen generator and its standard net/http client, so the SDK depends only on the widely-used upstream toolchain and the Go standard library for HTTP. The hand-written client wrappers are reworked onto the generated net/http client: request customisation (the Airflow-API-Version and Correlation-Id headers, the Edge worker per-request JWT) moves to oapi-codegen request editors, bearer-token cloning is reimplemented over the generated client, and the Edge worker's retry behaviour moves to an http.RoundTripper. Consumers use the generated typed *WithResponse methods, and the mocks are regenerated against the new interfaces. The resty debug-logging bridge is dropped along with the dependency.
Member
Author
|
Closed as I prefer to fix with Ash's upstream package instead of dropping the whole |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Go SDK's Execution API (
pkg/api) and Edge worker API (pkg/edgeapi) clients were produced by a bespoke, resty-based code generator and usedresty.dev/v3as their HTTP client. This moves both clients onto the widely-used upstreamgithub.com/oapi-codegen/oapi-codegengenerator with its standardnet/httpclient, so the SDK's HTTP stack is just the Go standard library plus the mainstream oapi-codegen toolchain.What
oapi-codegenv2 (net/httpclient). The generator config is unchanged apart from dropping generator-specific options that upstream covers by default; the existing overlays (operationId renames,x-go-type, header removal) still apply.Airflow-API-Version/Correlation-Idheaders and the Edge worker's per-request JWT become oapi-codegen request editors.WithBearerTokencloning is reimplemented over the generated client.http.RoundTripper.sdk/client.go,pkg/worker/runner.go,edge/worker.go) use the generated typed*WithResponsemethods; non-2xx handling goes through a smallCheckResponsehelper.ClientWithResponsesInterface), and the tests are updated to drive the flat client.resty.dev/v3dependency;go.mod/go.sum(and the lang-SDK Go example module) are re-tidied.The one intentional behaviour change: the Edge worker no longer emits resty's per-request debug log lines (the
api_client.debugpath); everything else — headers, auth, retry semantics, typed responses — is preserved.go build ./...,go vet, andgo test ./...pass for the Go SDK.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines