We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
C# auto generated aspnetcore project contains invalid enums
aspnetcore
2.3.1
Gist here
yaml code
status: type: "string" description: "pet status in the store" enum: - "available" - "pending" - "sold"
editor.swagger.io
public enum StatusEnum { /// <summary> /// Enum AvailableEnum for available /// </summary> [EnumMember(Value = available)] AvailableEnum = 1, /// <summary> /// Enum PendingEnum for pending /// </summary> [EnumMember(Value = pending)] PendingEnum = 2, /// <summary> /// Enum SoldEnum for sold /// </summary> [EnumMember(Value = sold)] SoldEnum = 3 }
This is invalid C#, the Value = x should be Value = "x".
Value = x
Value = "x"
Possibly related
Generated model should look like the following:
public enum StatusEnum { /// <summary> /// Enum AvailableEnum for available /// </summary> [EnumMember(Value = "available")] AvailableEnum = 1, /// <summary> /// Enum PendingEnum for pending /// </summary> [EnumMember(Value = "pending")] PendingEnum = 2, /// <summary> /// Enum SoldEnum for sold /// </summary> [EnumMember(Value = "sold")] SoldEnum = 3 }
The text was updated successfully, but these errors were encountered:
i suggest updating src/main/resources/csharp/enumClass.mustache @ line 14, see #8027 for reference
Sorry, something went wrong.
No branches or pull requests
Description
C# auto generated
aspnetcore
project contains invalid enumsSwagger-codegen version
2.3.1
Swagger declaration file content or url
Gist here
yaml code
Command line used for generation
editor.swagger.io
Steps to reproduce
aspnetcore
serverThis is invalid C#, the
Value = x
should beValue = "x"
.Related issues/PRs
Possibly related
Suggest a fix/enhancement
Generated model should look like the following:
The text was updated successfully, but these errors were encountered: