Create and include an analyzer that validates action method return types match the declared ActionResult<T>
Open
affected-medium
analyzer
area-mvc
enhancement
feature-openapi
severity-minor
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
Add an analyzer that validates the return types from an action method returning `ActionResult`, e.g. don't let it return `ObjectResult` with a different T value, e.g. the following is invalid:
``` csharp
[HttpGet]
public ActionResult> Get()
{
return new ObjectResult(new { Not = "Valid" });
}
```
Contributor guide
Assessment
This issue has not been assessed yet.