Skip to content

Commit

Permalink
Remove redundant Any() call (#2824)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Apr 23, 2024
1 parent c9b7741 commit c936acb
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,10 @@ private IEnumerable<string> InferRequestContentTypes(ApiDescription apiDescripti
if (explicitContentTypes.Any()) return explicitContentTypes;

// If there's content types surfaced by ApiExplorer, use them
var apiExplorerContentTypes = apiDescription.SupportedRequestFormats
return apiDescription.SupportedRequestFormats
.Select(format => format.MediaType)
.Where(x => x != null)
.Distinct();
if (apiExplorerContentTypes.Any()) return apiExplorerContentTypes;

return Enumerable.Empty<string>();
}

private OpenApiRequestBody GenerateRequestBodyFromFormParameters(
Expand Down

0 comments on commit c936acb

Please sign in to comment.