-
-
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] Add a generator for the gin framework #1048
Conversation
I would try to condense the java changes into the main go server/abstract generator and only create a separate template for the Gin server; if this is at all possible. |
@antihax Thank you very much for your review and comment! |
IMO it's ok to extends Go Gin generator just with Abstract Go class for day-1 requirement. If we see more Go server generators contributed by the community, we can refactor common code into an Abstract Go server class similar to what we've done for Java JAX-RS generators |
@@ -0,0 +1,180 @@ | |||
/* | |||
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) | |||
* Copyright 2018 SmartBear Software |
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.
@kemokemo I believe we no longer need line 3 for new files added directly to this project (OpenAPI Generator). Please refer to https://opensource.stackexchange.com/a/7301/12997 for more information.
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.
Thank you for your review and the information about the 'Copyright notice in the file header'.
I'll delete these 3 lines.
public String getHelp() { | ||
return "Generates a Go server library using OpenAPI-Generator. By default, " + | ||
"it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable."; | ||
} |
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.
@kemokemo I think we will need to revise the help text, e.g. to mention about Go Gin framework.
Does this generator also support the -Dnoservice
option?
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.
Oh.. Sorry.
I'll make the help message more appropriate and delete the mention about -Dnoservice
.
I had pushed some fixes. |
Sorry I wasn't clear. I mean still keeping the following line to give us (including you) for the contribution:
I've pushed 896d07b with the following:
If no further question/feedback on this PR, I'll merge it tomorrow (Friday) UPDATE: we'll later rename |
I had neglected confirmation. I'm sorry. |
I did some tests and was able to run it directly and via Docker. Partial result below:
|
PR merged into master. Thank you for your contribution 👍 |
I am glad that I could contribute to a wonderful project! |
@kemokemo please get some rest as it's late in Japan. I'll talk to you on Monday about further enhancement to the generator. Have a nice weekend. |
@kemokemo thanks again for the new generator, which is included in the v3.3.0 minor release: https://twitter.com/oas_generator/status/1046941449609068544 |
@wing328 Thank you so much for your support! I'm very happy 😄 |
* copy from go-server and add go-gin-server generator * change the templates for the gin * fix warnings of the golint tool * fix the path of script * add samples * delete unnecessary comments (OpenAPITools#1048) * make the help message more appropriate (OpenAPITools#1048) * fix the link address format (OpenAPITools#1048) * minor improvement
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.3.x
,4.0.x
. Default:master
.@antihax @bvwells @grokify
Description of the PR
Issue #1047
I respect the openapi-generator.
I would be pleased if you could give us your guidance.
Ref: Go Gin framework https://github.com/gin-gonic/gin