Open jeremyVignelles opened 3 years ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I think it is very similar to #32375 in the fact that nullability should be used to infer things, and as such, I think it is a good fit for this project : https://github.com/dotnet/aspnetcore/projects/18#card-64653068 as it simplifies the usage of MVC (don't need to declare the 204 type above the method)
What do you think ?
Related:
Describe the bug
When a controller method returns
null
, theHttpNoContentOutputFormatter
transforms the status code into a204 - No Content
instead of a200 - Ok
.However, API explorer does not document this possibility of 204.
To Reproduce
Create a MVC project with a controller.
Create a method that can return a nullable reference type, for example:
If that method returns
null
, the status code will be 204, which I assume is expected.Inspect ApiExplorer's metadata : The 204 status code is not documented.
Minimal diff Full code
Expected result: 200 and 204 should show up Actual result : Only 200 is displayed.
Further technical details
dotnet --info