Exceptions when returning IAsyncEnumerable create invalid ProblemDetails JSON response #60911
Closed
1 task done
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
Is there an existing issue for this?
Describe the bug
After switching my project to .NET 9 I observed that when generating an exception on endpoints that return an IAsyncEnumerable the response returned is different compared to .NET 8 - previously I would get a valid problem details response JSON object. In .NET 9 I get the response prefixed with the "[" character.
Expected Behavior
When IAsyncEnumerable throws an exception without returning any data previously I would expect to get a valid problem details JSON response without any additional characters.
Steps To Reproduce
I've created a minimal repo to illustrate this issue https://github.com/Desmont/StreamingIssueRepro
Exceptions (if any)
No response
.NET Version
9.0.201
Anything else?
The text was updated successfully, but these errors were encountered: