Goa HTTP codegen generates inconsistent transport code when a design combines:
- a request body that uses
OneOf(...)
- a ResultType that also uses
OneOf(...)
- viewed/projected results
In that situation, the generated packages can fail to build because different codegen paths disagree about the effective transport shape.
Observed failures include:
gen/http/{service}/client/cli.go references missing Validate*RequestBody helpers for OneOf request members
- generated client/server response unions reference branch body types that are not emitted
- viewed response bodies are projected in some places but not others, so generated client decode/init code still refers to fields removed by the selected view
Minimal repros:
- oneof_resulttype_client_bug:
Client CLI references missing Validate*RequestBody helpers for OneOf request-body members.
- oneof_direct_result_bug:
Direct ResultType response generates a union whose response branch body types are never emitted.
- oneof_result_projection_bug:
Projected/viewed responses mix projected and unprojected OneOf shapes, producing stale type references across client/server HTTP codegen.
Note: gpt-5.4-high came up with a fix (sevein@1e5c84e), in case it saves you some time. The fix seems to address the problem seen in the minimal repros above (sevein/examples@180abb3).
Goa HTTP codegen generates inconsistent transport code when a design combines:
OneOf(...)OneOf(...)In that situation, the generated packages can fail to build because different codegen paths disagree about the effective transport shape.
Observed failures include:
gen/http/{service}/client/cli.goreferences missingValidate*RequestBodyhelpers forOneOfrequest membersMinimal repros:
Client CLI references missing
Validate*RequestBodyhelpers forOneOfrequest-body members.Direct
ResultTyperesponse generates a union whose response branch body types are never emitted.Projected/viewed responses mix projected and unprojected
OneOfshapes, producing stale type references across client/server HTTP codegen.Note: gpt-5.4-high came up with a fix (sevein@1e5c84e), in case it saves you some time. The fix seems to address the problem seen in the minimal repros above (sevein/examples@180abb3).