RicoSuter/NSwag

Bug - NSwag generates bad code for an enum

Offen

#2.883 geöffnet am 09.06.2020

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C# (1.356 Forks)batch import
help wantedproject: NJsonSchemaproject: NJsonSchema.CodeGeneration.CSharpproject: NJsonSchema.CodeGeneration.TypeScripttype: bug

Repository-Metriken

Stars
 (7.358 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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

Contributor Guide