-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
feature-openapiold-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 labels
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Let's consider the following endpoint, in which every argument has been renamed with the corresponding attribute:
app.MapGet("/api/{id:guid}/search", ([FromRoute(Name = "id")] Guid searchId,
[FromQuery(Name = "q")] string searchText, [FromHeader(Name = "x-version")] string version) =>
{
return TypedResults.NoContent();
});
Resulting OpenAPI documentation will show the correct names:
However, if I just add the WithOpenApi extension method, then parameter names are ignored, so the generated documentation will become incorrect:
Expected Behavior
Parameter names should be taken into account even when using the WithOpenApi extension method.
Steps To Reproduce
Minimal repro here: https://github.com/marcominerva/ParameterRenameIssue.
Exceptions (if any)
No response
.NET Version
7.0.100
Anything else?
No response
Valecass, Galvy, totti240282, nanny07, max1997dc and 1 more
Metadata
Metadata
Assignees
Labels
feature-openapiold-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 labels

