Skip to content

URL Segment Versioned Controllers Do Not Report All API Versions #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
commonsensesoftware opened this issue Sep 17, 2016 · 0 comments
Closed
Assignees
Labels

Comments

@commonsensesoftware
Copy link
Collaborator

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
@commonsensesoftware commonsensesoftware self-assigned this Sep 17, 2016
commonsensesoftware pushed a commit that referenced this issue Sep 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant