Skip to content

Mvc.Api.Analyzers should treat IResult types correctly #40823

@brunolins16

Description

@brunolins16

A support for IResults types in MVC Action controller is going to be added by #40710, however Mvc.Api.Analyzers still treat IResult returned instances as user defined Model, that basically means an OkResult (HTTP Status Code: 200) and might suggest the adding of incorrect Produces* attributes or incorrect warnings.

Relevant code: https://github.com/dotnet/aspnetcore/blob/main/src/Mvc/Mvc.Api.Analyzers/src/ActualApiResponseMetadataFactory.cs

Originally posted by @pranavkm in #40710 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzerIndicates an issue which is related to analyzer experiencearea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions