-
Notifications
You must be signed in to change notification settings - Fork 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
Properly capitalize exported go types #7636
Conversation
Previously if the type was "myEnum" it would be written as ``` type myEnum string const ( DEMO MyEnum = "DEMO" ) ``` which would fail because of the capitalization difference. This fixes that.
Hi @achew22, just wondering if there is an issue filed for this PR? Couldn't see a reference to one here, but might have missed it... |
I didn't file one since I was just going to send a PR to fix it. Would you like me to open one? Is the description in the PR sufficient? |
Looks ok to me. I wanted to take a stab at fixing capitalization on some of the generated variables names also but time is running away from me. |
@antihax, does that imply you approve and it should be merged? |
@achew22 it might be worth adding this bug in the client test swagger located here: So that we make sure that there isn't a regression in future. Running https://github.com/swagger-api/swagger-codegen/blob/master/bin/go-petstore.sh will regenerate the client code. @wing328 could you advise whether an issue needs to be logged please. |
I'll review in the coming few days... |
@wing328 friendly ping 😄 |
@achew22 thanks for the PR, which looks good to me (sorry for the delay in merging due to Chinese New Year celebration) |
@achew22 I'll add "my_enum" (to cover underscore as well) to https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml later this week when I've time. |
@wing328, thanks so much for merging! I see you've tagged it with 2.4.0 as the destination release. Is there somewhere I can track the progress of that release? This bug is blocking the next major release for grpc-gateway and my hope was to get that out today or tomorrow. Would it be possible to do a really quick 2.3.2 or something? |
Would you consider using the |
I think the idea of doing |
Previously if the type was "myEnum" it would be written as
which would fail because of the capitalization difference. This fixes that.
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\
.3.0.0
branch for changes related to OpenAPI spec 3.0. Default:master
.Description of the PR
(details of the change, additional tests that have been done, reference to the issue for tracking, etc)