Results.Json(null) stopped producing a response body in .NET 8 (and 7) #53509
Labels
area-web-frameworks
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
Status: Resolved
Is there an existing issue for this?
Describe the bug
In .NET 8 (and 7) when a null value is given to Results.Json, it no longer outputs "null" in the response body, instead the response body is empty
Expected Behavior
null
is put in the response body
Steps To Reproduce
https://github.com/WGroenestein/ResultJsonRepro
Exceptions (if any)
No response
.NET Version
8.0.100
Anything else?
Since .NET 8 (the new LTS) was released Nov 2023 and .NET 6 (current targeted LTS) is EOL Nov 2024 we are trying to switch our projects over to .NET 8 (LTS => LTS upgrade). However this LTS upgrade causes our API contracts to break.
We didn't find anything related to this breaking change in the msdn docs (https://learn.microsoft.com/en-us/dotnet/core/compatibility/7.0 and https://learn.microsoft.com/en-us/dotnet/core/compatibility/8.0)
The text was updated successfully, but these errors were encountered: