ApiExplorer not aware of HttpNoContentOutputFormatter #28060
Labels
affected-few
This issue impacts only small number of customers
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
feature-openapi
severity-minor
This label is used by an internal tool
Milestone
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
The text was updated successfully, but these errors were encountered: