Mvc.Api.Analyzers should treat `IResult` types correctly
Open
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
Assessment
This issue has not been assessed yet.