dotnet / dotnet/aspnetcore

Mvc.Api.Analyzers should treat `IResult` types correctly

Open
#40,823 1 comment 0 reactions 0 assignees View on GitHub
analyzer area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

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 https://github.com/dotnet/aspnetcore/issues/40710#issuecomment-1068686855_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.