-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Update go-server template to include the conventional generated code line #18304
Conversation
…line Follow the convention from https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source. The generated go client code already follows this: https://github.com/OpenAPITools/openapi-generator/blob/f357be480e987827fb4bdf1f0d1b4a4ad20f1f85/modules/openapi-generator/src/main/resources/go/partial_header.mustache#L18
Good idea! Although we could put it anywhere as long as it comes before any code, I typically see this comment place at the first line. This is easier for us as we can just read the first line and know it is generated. It's up to you if you want to change it. LGTM as is. |
Both are within spec. Just that for us humans, we have to read all the other comments before coming to this one. I'll leave it up to you |
Sounds good, done! Let me know if you want me to do the same for the client code (I wasn't sure if we wanted to make a change in case we break some people who were assuming that it was the bottom line) |
@@ -1,3 +1,5 @@ | |||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. | |||
|
|||
/* |
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.
i'll file another PR to move it inside the /* .. */ comment block below to make the comment a bit more consistent.
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.
filed #18319
Follow the convention from https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source.
The generated go client code already follows this:
openapi-generator/modules/openapi-generator/src/main/resources/go/partial_header.mustache
Line 18 in f357be4
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)