-
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
[csharp] Referencing standalone enum generates uncompilable enum #7657
Comments
donqstepper
changed the title
[csharp] Referencing standalone enum multiple times generates uncompilable enum
[csharp] Referencing standalone enum generates uncompilable enum
Feb 14, 2018
spanglerco
added a commit
to spanglerco/swagger-codegen
that referenced
this issue
Oct 1, 2018
Depending on HashMap iteration order, the isString flag added to string enum values can be lost due to copying a reference to the allowableValues map to properties that reference the enum. The result is that the code fails to compile. This should fix swagger-api#7656, fix swagger-api#7657 (regarded as a duplicate of 7656), and fix swagger-api#8027 (which also appears to be the same issue).
spanglerco
added a commit
to spanglerco/swagger-codegen
that referenced
this issue
Oct 2, 2018
Depending on HashMap iteration order, the isString flag added to string enum values can be lost due to copying a reference to the allowableValues map to properties that reference the enum. The result is that the code fails to compile. This should fix swagger-api#7656, fix swagger-api#7657 (regarded as a duplicate of 7656), and fix swagger-api#8027 (which also appears to be the same issue).
4 tasks
should be fixed in #9936 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Duplicate, please close
Description
Using the csharp generator, when generating for a swagger definition which uses a referenced type which itself references a standalone enum type, the generated enum code is malformed/does not compile.
Swagger-codegen version
2.3.1 (does not happen in 2.3.0)
Also checked it still occurs on master as of aa6b217
Swagger declaration file content or url
Command line used for generation
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i swagger.yaml -l csharp -o /tmp/broken -DpackageName=CommentingServiceClient
Steps to reproduce
As you can see, this will not compile.
Related issues/PRs
Duplicate of #7656 - please close
Suggest a fix/enhancement
This issue goes away if you inline the definition of NewDiscussion (or DiscussionStatus, but that also removes the standalone enum class). Unfortunately this is not a viable workaround if you wish to reuse the type.
The text was updated successfully, but these errors were encountered: