Forum Discussion

DenesIsti's avatar
DenesIsti
New Contributor
5 years ago

SwaggerUI multiple values generated

I have a simple ASP.Net Core project with a simple controller. Nothing special. But when I load it up with swagger in the json file in the generated attributes I have a lot of duplicated value, for example: 

TypeAttributesinteger($int32)Enum:
[ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 16, 24, 32, 32, 128, 256, 1024, 2048, 4096, 8192, 16384, 65536, 131072, 196608, 196608, 262144, 264192, 1048576, 12582912 ]

If I generate a C# code from this with NSwagStudio I will get a lot of duplicated values, and the code will not compile. Any ideas how can I not generate these numbers?

 

  • Hi DenesIsti,

     

    This looks like a bug in the library/framework that you use to generate the OpenAPI definition (probably Swashbuckle). You should open a ticket with that library/framework.

  • Thanks, will post an issue on Swashbuckle.

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi DenesIsti,

     

    This looks like a bug in the library/framework that you use to generate the OpenAPI definition (probably Swashbuckle). You should open a ticket with that library/framework.

    • DenesIsti's avatar
      DenesIsti
      New Contributor

      Thanks, will post an issue on Swashbuckle.