diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs index 7baef87025..1da2de45ce 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs @@ -484,13 +484,10 @@ private IEnumerable 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(); } private OpenApiRequestBody GenerateRequestBodyFromFormParameters(