Skip to content

ProducesResponseType(typeof(void), ...) causes ApiExplorer to indicate the return type is ProblemDetails #7874

Closed
@kingmotley

Description

@kingmotley

Describe the bug

ApiExplorer/ProducesResponseType exposes incorrect value when the return type is void. It seems to override any attempt to indicate that the response produces no results/body with ProblemDetails.

To Reproduce

Steps to reproduce the behavior:

  1. Using this version of ASP.NET Core 2.2
  2. Apply the following attribute to an ApiController:
    [ProducesResponseType(typeof(void), (int)HttpStatusCode.Unauthorized)
  3. ApiExplorer indicates the return type is ProblemDetails.

Expected behavior

ApiExplorer should say the return type is void.

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedaffected-mediumThis issue impacts approximately half of our customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbreaking-changeThis issue / pr will introduce a breaking change, when resolved / merged.bugThis issue describes a behavior which is not expected - a bug.severity-majorThis label is used by an internal tool

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions