-
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
[Go] 2.3.0 enum support can lead to collisions #7300
Comments
any progress on this issue? can someone help to take a look? @frantuma |
4 tasks
CatTail
added a commit
to CatTail/databricks-sdk-go
that referenced
this issue
Feb 23, 2019
frantuma
pushed a commit
that referenced
this issue
Mar 5, 2019
implemented in #9234 |
I have same error
|
The issue regressed due to the checkin. Any reason why this is done? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When building a client with enums, it is possible to run into collisions using Go because the enum names are in the same name space.
Swagger-codegen version
2.3.0 using new enum support.
Swagger declaration file content or url
Collision example Open API 2.0 spec excerpt:
Both of these have an enum value,
transcript
which gets converted to the same constantTRANSCRIPT
in thevoicebase
package:voicebase.TRANSCRIPT
:File:
vb_include_type_enum.go
File:
vb_callback_type_enum.go
Compiling the client results in the following errors:
Command line used for generation
$ java -jar swagger-codegen-cli.jar generate -c swagger_voicebase_config.json -i swagger_voicebase_v3.yaml -l go -o .
Steps to reproduce
Generate the client and import the package.
Related issues/PRs
This is being tracked in the client SDK here:
grokify/go-voicebase-v3#4
Suggest a fix/enhancement
Prefix the constant name using upper case snake case
INCLUDE_TYPE_ENUM_TRANSCRIPT
CALLBACK_TYPE_ENUM_TRANSCRIPT
or UpperCamelCase:
IncludeTypeEnumTranscript
CallbackTypeEnumTranscript
The text was updated successfully, but these errors were encountered: