Closed
Description
When Web API controllers are versioned using a URL segment and the API versioning options are configured to report the supported and deprecated API versions, the complete set of API versions is not correctly reported.
For example:
[ApiVersion( "1.0" )]
[RoutePrefix( "api/v{version:apiVersion}/my" )]
public class MyController : ApiController
{
[Route]
public IHttpActionResult Get() => Ok();
}
[ApiVersion( "2.0" )]
[ApiVersion( "3.0" )]
[RoutePrefix( "api/v{version:apiVersion}/my" )]
public class My2Controller : ApiController
{
[Route]
public IHttpActionResult Get() => Ok();
}
Request | Expected Result | Actual Result |
---|---|---|
GET /api/v1/my | api-supported-versions: 1.0, 2.0, 3.0 | api-supported-versions: 1.0 |
GET /api/v2/my | api-supported-versions: 1.0, 2.0, 3.0 | api-supported-versions: 2.0, 3.0 |
GET /api/v3/my | api-supported-versions: 1.0, 2.0, 3.0 | api-supported-versions: 2.0, 3.0 |