Skip to content

openapi-codegen: support components.headers - #5476

Draft
magdzikk wants to merge 4 commits into
masterfrom
worktree-spec-update
Draft

openapi-codegen: support components.headers#5476
magdzikk wants to merge 4 commits into
masterfrom
worktree-spec-update

Conversation

@magdzikk

Copy link
Copy Markdown

openapi-codegen decodes components.parameters but not components.headers. The section was silently dropped at decode time, and OpenapiHeaderRef.resolved only ever consulted components.parameters (additionally requiring in: header), so a response header written as $ref: '#/components/headers/Foo' passed ref validation and then failed at generation with IllegalStateException: Response component #/components/headers/Foo is referenced but not found.

This adds headers to OpenapiComponent, re-keyed by full ref exactly as parameters already is; makes OpenapiHeaderRef.resolved consult components.headers first and fall back to components.parameters unchanged; and adds the missing headers case to OpenApiMerger.

Documents that do not use components.headers are unaffected.

Tests: openapiCodegenCore2_12/test 105 passing, openapiCodegenCore3/test 115 passing, scalafmtCheckAll clean.

🤖 Generated with Claude Code

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.

1 participant