`RequestDelegate`-based handlers do not surface in OpenAPI descriptions
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
hi I found that the minimal Api TypedResults method does not automatically inject HttpContext.
The httpcontext principle is here in the reference
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis?view=aspnetcore-7.0#binding-precedence
### Expected Behavior
The TypedResults method can automatically inject HttpContext.
### Steps To Reproduce
File:Program.cs
```
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.MapGroup("/connect").MapConnect();
app.Run();
```
File:Connect.cs
```
public static class Connect
{
public static RouteGroupBuilder MapConnect(this RouteGroupBuilder group)
{
group.MapGet("/authorize", AuthorizeAsync);
group.MapGet("/GoodMinimalApi", GoodMinimalApi);
return group;
}
public static async Task GoodMinimalApi() // not HttpContext
{
await Task.CompletedTask;
return TypedResults.Ok();
}
public static async Task AuthorizeAsync(HttpContext context)
{
await Task.CompletedTask;
return TypedResults.Ok();
}
}
```
End result

### Exceptions (if any)
_No response_
### .NET Version
dotnet 7.0
### Anything else?
Microsoft Visual Studio Enterprise 2022 (64 位) - Current版本 17.4.0
ASP.NET Core 7
Minimal Api
Contributor guide
Assessment
This issue has not been assessed yet.