Versioning: [ApiVersion("1")] turns into decimal (1.0) in Swagger?

259 Views Asked by At

I have an .net core 2.2 API where I'd like to have 2 different API versions in my controllers.

    [ApiController]
    [ApiVersion("1")]
    [ApiVersion("1-pbi")]
    [Route("api/v{version:apiVersion}/[controller]")]

And on each controller method I've assigned which version it should map to. [MapToApiVersion("1")]

However, when I use [MapToApiVersion("1-pbi")] it works perfectly well, but when I use [MapToApiVersion("1")] the URL in swagger suddenly turns into a decimal 1.0. I've tried to find a solution, but with not avail. Has anyone perhaps encountered this and knows a workaround?

Thank you in advance!

0

There are 0 best solutions below