Skip to content
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

Convention-Based Action Routes Do Not Return 400 as Expected #26

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

Comments

@commonsensesoftware
Copy link
Collaborator

Controllers that use convention-based routing do not always return 400 for actions that match in some API versions, but not others.

For example:

[ApiVersion( "1.0" )]
public class MyController : ApiController
{
   public IHttpActionResult Get() => Ok();
}
[ApiVersion( "2.0" )]
public class My2Controller : ApiController
{
   public IHttpActionResult Get() => Ok();
   public IHttpActionResult Patch() => StatusCode( HttpStatusCode.NoContent );
}
[ApiVersion( "3.0" )]
public class My3Controller : ApiController
{
   public IHttpActionResult Get() => Ok();
}

The requested routes should produce the following results:

Request Expected Result Actual Result
PATCH /my?api-version=1.0 400 404
PATCH /my?api-version=2.0 204 204
PATCH /my?api-version=3.0 400 404
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