-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Add option to use http.Header.Set when setting headers in Go client #24791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -41,6 +41,8 @@ public class GoClientOptionsProvider implements OptionsProvider { | |||||
| public static final boolean GENERATE_UNMARSHAL_JSON_VALUE = true; | ||||||
| public static final boolean USE_DEFAULT_VALUES_FOR_REQUIRED_VARS_VALUE = true; | ||||||
| public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; | ||||||
| public static final boolean USE_HTTP_HEADER_SET = true; | ||||||
|
|
||||||
|
|
||||||
| @Override | ||||||
| public String getLanguage() { | ||||||
|
|
@@ -68,6 +70,7 @@ public Map<String, String> createOptions() { | |||||
| .put("structPrefix", "true") | ||||||
| .put(CodegenConstants.USE_DEFAULT_VALUES_FOR_REQUIRED_VARS, "true") | ||||||
| .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) | ||||||
| .put("useHttpHeaderSet", "true") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The new Prompt for AI agents
Suggested change
|
||||||
| .build(); | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The new useHttpHeaderSet option has no test coverage. Every other Go generator option is exercised in GoClientOptionsTest via GoClientOptionsProvider, but this one is skipped, so a regression in wiring (e.g. the option not being parsed or written back) would pass the build silently. Add USE_HTTP_HEADER_SET to GoClientOptionsProvider, verify setUseHttpHeaderSet in GoClientOptionsTest, and add a test asserting the generated prepareRequest uses headers.Set when true and direct assignment when false.
Prompt for AI agents