[Minimal APIs] async handlers with single `HttpContext` parameter are not working
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
It seems that issue described in https://github.com/dotnet/aspnetcore/issues/39956 was not fixed but even got worse - Minimal APIs handler with single param of type `HttpContext` results in empty response.
```csharp
app.MapPost("testpost_works", async (HttpContext context, CancellationToken ct) => await Task.FromResult(context.Request.Method + " response"));
app.MapPost("testpost_fails", Handler);
app.MapGet("testget_works", async (HttpContext context, CancellationToken ct) => await Task.FromResult(context.Request.Method + " response"));
app.MapGet("testget_fails1", async (HttpContext context) => await Task.FromResult(context.Request.Method + " response"));
app.MapGet("testget_fails2", Handler);
async Task Handler(HttpContext context) => await Task.FromResult(context.Request.Method + "response");
```
Endpoints suffixed `fails` return empty result while others return "VERB response"
In addition only "works" endpoints are recognized by swagger:

### Expected Behavior
All endpoints return "VERB response"
### Steps To Reproduce
Use Minimal APIs defined above.
### Exceptions (if any)
_No response_
### .NET Version
7.0.100
### Anything else?
> dotnet --info
.NET SDK:
Version: 7.0.100
Commit: e12b7af219
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.100\
Contributor guide
Assessment
This issue has not been assessed yet.