fix(management): getCampaign returns Campaign directly, not wrapped#242
Merged
jeroenrinzema merged 1 commit intoJun 17, 2026
Merged
Conversation
The getCampaign OpenAPI response was declared as { data: Campaign }, but the
handler (campaigns.go GetCampaign) returns the Campaign directly via
json.Write(w, ..., campaign.OAPI()) — matching every other single-resource GET
(getJourney/getProject/getUser/getList). The wrapper was an outlier that made
the generated clients describe a response shape the backend never sends.
Corrects the spec and regenerates the Go (resources_gen.go) and TypeScript
(management.generated.ts) bindings. No Go code consumed the old wrapped shape.
c4a44f7 to
6f5c784
Compare
a7b9451 to
feac4d8
Compare
ecc51a1
into
feat/console-openapi-migration
6 checks passed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Corrects an OpenAPI spec inaccuracy:
getCampaignwas declared to return{ data: Campaign }, but the handler returns theCampaigndirectly.Every other single-resource GET (
getJourney,getProject,getUser,getList) already returns its schema directly —getCampaign'sdatawrapper was the lone outlier, so the generated clients described a response shape the backend never sends.Changes
resources.yml:getCampaign200 response →$ref: Campaign(direct).resources_gen.go(Go) andmanagement.generated.ts(TS) with the pinnedoapi-codegenv2.7.0 +openapi-typescript.Verification
go build ./...andgo vet ./internal/http/controllers/v1/management/...: clean.tsc --noEmitinconsole: 0 errors.GetCampaignResponse.JSON200.Datashape.Follow-up to the console OpenAPI migration (#241), which currently reads this response per the backend behaviour with a documented cast; that cast can be removed once this lands.