dotnet/aspnetcore
GitHub で見るAnalyzers API1000 and API1001 should trigger on conditional returns
Open
#33,105 opened on 2021年5月28日
analyzerarea-mvcfeature-openapigood first issuehelp wanted
Repository metrics
- Stars
- (37,933 stars)
- PR merge metrics
- (平均マージ 16d 9h) (30d で 258 merged PRs)
説明
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
}