-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Labels
Pri1Source - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issueaspnet-core/svcdoc-enhancementfundamentals/subsvcseQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.
Description
Description
In the documentation :
The [Description] attribute works in an MVC app but doesn't work in a Minimal API app at this time. For more information, see Description parameter of ProducesResponseTypeAttribute does not work in minimal API app (dotnet/aspnetcore #60518).
But the ticket dotnet/aspnetcore#60518 seems about response description, not parameter description. Moreover [DescriptionAttribute] works as expected on lambda parameter or method parameter.
With this code :
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAuthorization();
builder.Services.AddOpenApi();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}
app.MapGet("/test", ([System.ComponentModel.Description("The parameter one")] string param1) => { });
app.Run();The generated OpenAPI specification is :
{
...
"parameters": [
{
"name": "param1",
"in": "query",
"description": "The parameter one",
"required": true,
"schema": {
"type": "string"
}
}
],
...
}So the below citation in the documentation seems to be incorrect.
If you want, I can do a PR to fix it.
Page URL
Content source URL
Document ID
cbc730ec-642f-480d-4a41-044c6c6ef7d3
Platform Id
4bbf4c77-ca40-25d5-0673-fab1102c2291
Article author
Metadata
- ID: cbc730ec-642f-480d-4a41-044c6c6ef7d3
- PlatformId: 4bbf4c77-ca40-25d5-0673-fab1102c2291
- Service: aspnet-core
- Sub-service: fundamentals
wadepickett
Metadata
Metadata
Assignees
Labels
Pri1Source - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issueaspnet-core/svcdoc-enhancementfundamentals/subsvcseQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.