dotnet/aspnetcore
Vedi su GitHubAnalyzers API1000 and API1001 should trigger on conditional returns
Open
#33.105 aperta il 28 mag 2021
analyzerarea-mvcfeature-openapigood first issuehelp wanted
Metriche repository
- Star
- (37.933 star)
- Metriche merge PR
- (Merge medio 16g 9h) (258 PR mergiate in 30 g)
Descrizione
Describe the solution you'd like
Analyzers API1000 and API1001 should trigger on returns (or expression-bodied methods) with conditional expressions.
Additional context
public ActionResult<object> OopsUndocumentedIf(int id)
{
if (id == 0)
{
return NotFound(); // API1000
}
return Ok(new object());
}
public ActionResult<object> OopsUndocumentedConditional(int id)
{
return id == 0 ? NotFound() : Ok(new object()); // No API1000
}