On asp.net controllers, a return type of
IActionResult is equivalent to returning an
object. There is no descriptor about the payload, so clients cant use code gen tools and have to rely on trial and error or documentation to manually work out the return payload types. The attribute
[ProducesResponseType] addresses this when its applied with a Type` parameter.
So the specific proposed rule is that any function that has IActionResult as a return type for that is on a Controller (a class that derives from ContollerBase) must have a Type described for the OK/200 response in the [ProducesResponseType] attributes. The absence of the attribute or the type for the attribute should be a violation to the rule.