RicoSuter/NSwag

Bug - NSwag generates bad code for an enum

Open

#2,883 建立於 2020年6月9日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)C# (1,189 fork)batch import
help wantedproject: NJsonSchemaproject: NJsonSchema.CodeGeneration.CSharpproject: NJsonSchema.CodeGeneration.TypeScripttype: bug

倉庫指標

Star
 (6,291 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I have 2 DTOs, both contain same Enum image

I have 2 controller methods using those DTO as URL query args image

I have 2 swagger definitions with same Enum image

And I get bad code from NSwag with "2" added to Enum name image

If this is not a bug then what am I doing wrong? Also this seem to be wrong only on method signature of the generated interface and the class, once I remove "2" the code compiles and I think it's generally ok code

image

貢獻者指南