I'm trying to version my WebApi's endpoints using Microsoft.AspNet.WebApi.Versioning. I added the [ApiVersion] attribute to the controllers enter image description here

and I configured SwaggerConfig.cs as it follows: enter image description here

...

enter image description here

WebApiConfig.cs enter image description here

two of those endpoints have the same route "users/all", one in "v1" controller and other in "v2" controller

Everything was going ok, I'm able to reach the two different endpoints that contain the same routes (users/all) via POSTMAN app, passing the "api-version" custom header.

The problem is, when I try to do it via Swagger UI, it does not identifies the "v2" endpoint in the UI, so that, I'm not able to try it via Swagger UI, and also, I'm not able to generate the "v2" endpoint client via AutoRest.

Summarizing: I'm not able to generate Swagger UI's docs or AutoRest client classes, for endpoints w/ same route (users/all), when versioning the webapi via custom Headers.

Could you guys help me please? Thanks in advance.

0

There are 0 answers