FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Optional response header by ShouheiNishi · Pull Request #1412 · oapi-codegen/oapi-codegen · GitHub

Optional response header - #1412

Closed
ShouheiNishi wants to merge 9 commits into
oapi-codegen:mainfrom
ShouheiNishi:fix/optional-response-header
Closed

Optional response header#1412
ShouheiNishi wants to merge 9 commits into
oapi-codegen:mainfrom
ShouheiNishi:fix/optional-response-header

Conversation

ShouheiNishi commented Dec 28, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

To fix issue #1301, when header is optional, field for this is generate as pointer type. When this field is nil, corresponding header is not set in functions Visit*.
However, this change introduce some incompatibility.
So we add compatibility option.

And this PR included PR #1411.

ShouheiNishi marked this pull request as ready for review December 28, 2023 04:16

Copy link
Copy Markdown
Member

Thank you for submitting this PR, @ShouheiNishi — but we need to close it because it has been superseded by #2301 (commit a4c36dc2), which landed all three elements you proposed: pointer types for optional headers (*T via GoTypeDef() in pkg/codegen/operations.go), nil-guards on w.Header().Set() in the strict-server templates, and a HeadersImplicitlyRequired compatibility flag for users relying on the old behavior. The originally-linked issue #1301 is now fixed.

Apologies for the long wait. We really do appreciate the contribution — it pointed at the right problem and the right shape of fix.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL