Is there an existing issue for this?
Describe the bug
Generated responses (status codes) in OpenAPI documents are inconsistent when returning a result TResult, that result as part of Results<TResults, NotFound> or Results<TResults, NotFound, Ok>.
Expected Behavior
all the following methods should include a 200 response:
FileStreamHttpResult Get(...)
Results<FileStreamHttpResult, NotFound> Get(...)
Results<FileStreamHttpResult, NotFound, Ok> Get(...)
The latter being our current workaround.
Steps To Reproduce
dotnet new webapi
dotnet package add Microsoft.Extensions.ApiDescription.Server
add the following before app.Run()
app.MapGet("/ok200", () => TypedResults.File([]));
app.MapGet("/NOK/", new Func<Results<FileContentHttpResult, NotFound>>(() => TypedResults.File([])));
app.MapGet("/okok/", new Func<Results<FileContentHttpResult, NotFound, Ok>>(() => TypedResults.NotFound()));
Exceptions (if any)
No response
.NET Version
10.0.300
Anything else?
related: #65371
Is there an existing issue for this?
Describe the bug
Generated responses (status codes) in OpenAPI documents are inconsistent when returning a result TResult, that result as part of Results<TResults, NotFound> or Results<TResults, NotFound, Ok>.
Expected Behavior
all the following methods should include a 200 response:
The latter being our current workaround.
Steps To Reproduce
add the following before
app.Run()Exceptions (if any)
No response
.NET Version
10.0.300
Anything else?
related: #65371