Skip to content

fix(gen): distinct wrapper types for shared body with differing headers#1679

Merged
ernado merged 1 commit into
ogen-go:mainfrom
benburkert:fix-shared-body-differing-headers
May 30, 2026
Merged

fix(gen): distinct wrapper types for shared body with differing headers#1679
ernado merged 1 commit into
ogen-go:mainfrom
benburkert:fix-shared-body-differing-headers

Conversation

@benburkert

Copy link
Copy Markdown
Contributor

Widen the wtypes cache key to include the response header set so operations sharing a body schema but declaring different headers no longer collapse into one wrapper. When the schema-derived name is already claimed by a wrapper with a different header set, fall back to the operation-specific name to avoid a type-name conflict.

I chose to intern the header keys as a jsonschema.Ref vs adding a non-jsonschema.Ref value to the key, which would have been a larger change. I can propose a distinct wtypeKey type if that's preferable.

Widen the wtypes cache key to include the response header set so operations
sharing a body schema but declaring different headers no longer collapse
into one wrapper. When the schema-derived name is already claimed by a
wrapper with a different header set, fall back to the operation-specific
name to avoid a type-name conflict.
@ernado ernado merged commit 3d93f01 into ogen-go:main May 30, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants