-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Go] properly set header parameters on api clients #14586
Conversation
ccfc692
to
5381ceb
Compare
cc Go maintainers @antihax @grokify @kemokemo @jirikuncar @ph4r5h4d. I believe I'll have some test failures that I'll need to resolve, but I'm having a difficult time getting the Swagger tests to run locally. |
@sokolikp can you please PM me via Slack when you've time so that I can help you with the test? https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g |
@wing328 thanks, I'll try pinging tomorrow! Logging off for the night. |
5381ceb
to
96d6edf
Compare
samples/client/echo_api/java/apache-httpclient/.openapi-generator/VERSION
Outdated
Show resolved
Hide resolved
96d6edf
to
607aff1
Compare
a3af6e5
to
60254c5
Compare
{{/required}} | ||
{{^required}} | ||
if r.{{paramName}} != nil { | ||
parameterAddToQuery(localVarQueryParams, "{{baseName}}", r.{{paramName}}, "{{collectionFormat}}") | ||
parameterAddToHeaderOrQuery(localVarHeaderParams, "{{baseName}}", r.{{paramName}}, "{{collectionFormat}}") |
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.
L245 and L249 are the most important changes in this PR. This passes localVarHeaderParams
instead of localVarQueryParams
.
@wing328 when you have a chance, could you help me re-kick off the CI tests? Looks like I'm unable. |
When I run
When I run
I'm not sure whether either of these are important given when I'm trying to update. @wing328 let me know if you have ideas on how to fix these. |
Note that the updated |
Ah I found this thread where it indicates to run with:
This resolves more errors for me! It works for on on all scripts except one:
To recap:
|
c272452
to
df02377
Compare
modules/openapi-generator/src/main/resources/go/client.mustache
Outdated
Show resolved
Hide resolved
df02377
to
877c9eb
Compare
Closed via #14637 |
Context
This PR addresses #14578. Request headers were being improperly added as query params for Go clients. This PR:
parameterAddToQuery
(added in [Go] report correctly the parameters with the deep object specification #13909) toparameterAddToHeaderOrQuery
to indicate that a header or query interface arg can be passedlocalVarHeaderParams
(instead oflocalVarQueryParams
) to the above function for header paramssamples
based on the above. Note that there are some automatic formatting/indentation changes to the samples - I can update those if necessary.PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(6.3.0) (minor release - breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks)