[go-server] fix imports with go generation#18514
[go-server] fix imports with go generation#18514wing328 merged 7 commits intoOpenAPITools:masterfrom
Conversation
| } | ||
|
|
||
| additionalProperties.put("hasPathParams", hasPathParams); | ||
| additionalProperties.put("hasBodyParams", hasBodyParams); |
There was a problem hiding this comment.
thanks for the PR. does this fix work for APIs with different tags (e.g. Pet, User) ? looks like if Pet APIs have an endpoint with body parameter while Users APIs doesn't have any body parameter, hasBodyParams is also set to true for Users APIs (operations).
There was a problem hiding this comment.
I actually added an open api spec and a sample generated code that creates 3 different api files with their own tags (api_none.go, api_body.go, api_path.go) to test 3 different cases, I haven't make a case for "both" but the logic is independent for both case and just a combination of body and path tag.
Each of them has the imports according to what they need to use.
There was a problem hiding this comment.
That's good. I'll do some tests later to confirm
| @@ -0,0 +1,8 @@ | |||
| generatorName: go-server | |||
| outputDir: samples/server/others/go-server/no-body-path-params | |||
There was a problem hiding this comment.
please add the output folder to .github/workflows/samples-go.yaml so that the CI can test the output moving forward
|
thanks for the fix. let's give it a try |
This fixes the import issues raised in issue 5153
PR checklist
Commit all changed files.
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*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming 7.1.0 minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)