-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.old-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labelsseverity-minorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Description
Describe the bug
Given the following action method bound to multiple routes:
[HttpGet]
[Route("foo")]
[Route("bar/{id}")]
public IActionResult Get(int id = 0)As expected, the ApiExplorer surfaces two ApiDescription instances, one for each route. However, for the first route "foo", the ApiDescription includes the id path parameter, despite the fact that it's not part of the route template. For example, here's the ApiExplorer data (serialized as json):
[
{
relativePath: "Test/foo",
httpMethod: "GET",
parameters: [
{
name: "id",
source: {
displayName: "Path",
id: "Path",
isGreedy: false,
isFromRequest: true,
},
}
],
},
{
relativePath: "Test/bar/{id}",
httpMethod: "GET",
parameters: [
{
name: "id",
source: {
displayName: "Path",
id: "Path",
isGreedy: false,
isFromRequest: true,
},
}
],
},
]
To Reproduce
> git clone [email protected]:domaindrivendev/ApiExplorerIssue.git
> cd ApiExplorerIssue
> dotnet run
Then navigate to "http://localhost:5000/apidescriptions" to see the ApiExplorer data
Further technical details
- ASP.NET Core version: 3.1
Metadata
Metadata
Assignees
Labels
affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.old-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labelsseverity-minorThis label is used by an internal toolThis label is used by an internal tool