From 6ad74743f7ff95d42866e0869f8381075340336e Mon Sep 17 00:00:00 2001 From: Ali AbuSaleh Date: Sun, 17 Jan 2021 10:50:58 +0200 Subject: [PATCH 1/2] targeting net461 --- .../AnnotationsDocumentFilter.cs | 8 +- .../AnnotationsOperationFilter.cs | 6 +- .../AnnotationsParameterFilter.cs | 6 +- .../AnnotationsRequestBodyFilter.cs | 6 +- .../AnnotationsSchemaFilter.cs | 8 +- .../AnnotationsSwaggerGenOptionsExtensions.cs | 6 +- .../SwaggerParameterAttribute.cs | 2 +- .../SwaggerRequestBodyAttribute.cs | 2 +- .../SwaggerResponseAttribute.cs | 4 +- .../SwaggerSchemaFilterAttribute.cs | 2 +- .../SwaggerTagAttribute.cs | 2 +- .../Swashbuckle.AspNetCore.Annotations.csproj | 10 +- .../ApiTestFixture.cs | 4 +- ... Backup.AspNetCore.ApiTesting.Xunit.csproj | 25 ++++ ...hbuckle.AspNetCore.ApiTesting.Xunit.csproj | 9 +- .../ApiTestRunnerBase.cs | 4 +- .../ApiTestRunnerOptions.cs | 2 +- .../HttpHeadersExtensions.cs | 5 +- .../IContentValidator.cs | 4 +- .../JsonContentValidator.cs | 6 +- .../JsonValidation/IJsonValidator.cs | 2 +- .../JsonValidation/JsonAllOfValidator.cs | 6 +- .../JsonValidation/JsonAnyOfValidator.cs | 6 +- .../JsonValidation/JsonArrayValidator.cs | 11 +- .../JsonValidation/JsonBooleanValidator.cs | 4 +- .../JsonValidation/JsonNullValidator.cs | 4 +- .../JsonValidation/JsonNumberValidator.cs | 4 +- .../JsonValidation/JsonObjectValidator.cs | 11 +- .../JsonValidation/JsonOneOfValidator.cs | 6 +- .../JsonValidation/JsonStringValidator.cs | 4 +- .../JsonValidation/JsonValidator.cs | 4 +- .../OpenApiDocumentExtensions.cs | 2 +- .../OpenApiSchemaExtensions.cs | 4 +- .../RequestValidator.cs | 10 +- .../ResponseValidator.cs | 4 +- ...ckle - Backup.AspNetCore.ApiTesting.csproj | 30 ++++ .../Swashbuckle.AspNetCore.ApiTesting.csproj | 13 +- src/Swashbuckle.AspNetCore.Cli/Program.cs | 18 +-- .../Swashbuckle.AspNetCore.Cli.csproj | 12 +- .../NewtonsoftServiceCollectionExtensions.cs | 8 +- .../SchemaGenerator/JsonPropertyExtensions.cs | 6 +- .../SchemaGenerator/NewtonsoftBehavior.cs | 50 +++---- .../Swashbuckle.AspNetCore.Newtonsoft.csproj | 11 +- .../ReDocBuilderExtensions.cs | 3 +- .../ReDocMiddleware.cs | 22 +-- .../ReDocOptionsExtensions.cs | 4 +- .../Swashbuckle.AspNetCore.ReDoc.csproj | 26 +++- .../SwaggerBuilderExtensions.cs | 10 +- .../ISwaggerProvider.cs | 6 +- .../SwaggerEndpointOptions.cs | 7 +- .../SwaggerMiddleware.cs | 13 +- .../SwaggerOptions.cs | 8 +- ...hbuckle - Backup.AspNetCore.Swagger.csproj | 30 ++++ .../Swashbuckle.AspNetCore.Swagger.csproj | 15 +- .../ConfigureSchemaGeneratorOptions.cs | 4 +- .../ConfigureSwaggerGeneratorOptions.cs | 6 +- .../DependencyInjection/DocumentProvider.cs | 8 +- .../SwaggerGenOptionsExtensions.cs | 6 +- .../SwaggerGenServiceCollectionExtensions.cs | 6 +- .../SchemaGenerator/ISchemaFilter.cs | 4 +- .../SchemaGenerator/ISerializerBehavior.cs | 2 +- .../SchemaGenerator/MemberInfoExtensions.cs | 4 +- .../OpenApiSchemaExtensions.cs | 4 +- .../SchemaGenerator/SchemaGenerator.cs | 12 +- .../SchemaGenerator/SchemaGeneratorOptions.cs | 4 +- .../SchemaGenerator/SystemTextJsonBehavior.cs | 49 ++++--- .../ApiDescriptionExtensions.cs | 8 +- .../ApiParameterDescriptionExtensions.cs | 10 +- .../SwaggerGenerator/IDocumentFilter.cs | 4 +- .../SwaggerGenerator/IOperationFilter.cs | 4 +- .../SwaggerGenerator/IParameterFilter.cs | 4 +- .../SwaggerGenerator/IRequestBodyFilter.cs | 4 +- .../SwaggerGenerator/ISchemaGenerator.cs | 4 +- .../SwaggerGenerator/OpenApiAnyFactory.cs | 4 +- .../SwaggerGenerator/SchemaRepository.cs | 4 +- .../SwaggerGenerator/SwaggerGenerator.cs | 12 +- .../SwaggerGeneratorOptions.cs | 6 +- .../Swashbuckle.AspNetCore.SwaggerGen.csproj | 137 +++++++++++++++++- .../XmlComments/XmlCommentsDocumentFilter.cs | 8 +- .../XmlComments/XmlCommentsOperationFilter.cs | 4 +- .../XmlComments/XmlCommentsParameterFilter.cs | 4 +- .../XmlCommentsRequestBodyFilter.cs | 4 +- .../XmlComments/XmlCommentsSchemaFilter.cs | 6 +- .../SwaggerUIBuilderExtensions.cs | 3 +- .../SwaggerUIMiddleware.cs | 24 +-- .../SwaggerUIOptions.cs | 6 +- .../SwaggerUIOptionsExtensions.cs | 10 +- .../Swashbuckle.AspNetCore.SwaggerUI.csproj | 15 +- .../Swashbuckle.AspNetCore.csproj | 9 +- 89 files changed, 613 insertions(+), 285 deletions(-) create mode 100644 src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle - Backup.AspNetCore.ApiTesting.Xunit.csproj create mode 100644 src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle - Backup.AspNetCore.ApiTesting.csproj create mode 100644 src/Swashbuckle.AspNetCore.Swagger/Swashbuckle - Backup.AspNetCore.Swagger.csproj diff --git a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsDocumentFilter.cs b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsDocumentFilter.cs index da3ec0b4a8..6b1b9e4a0f 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsDocumentFilter.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsDocumentFilter.cs @@ -1,9 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; +using System; +using System.Collections.Generic; +using System.Linq; namespace Swashbuckle.AspNetCore.Annotations { diff --git a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsOperationFilter.cs b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsOperationFilter.cs index 4ea4ec90fe..51bc73c285 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsOperationFilter.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsOperationFilter.cs @@ -1,8 +1,8 @@ -using System; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; +using System; using System.Collections.Generic; using System.Linq; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; namespace Swashbuckle.AspNetCore.Annotations { diff --git a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsParameterFilter.cs b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsParameterFilter.cs index 1c0304042a..e17477eba8 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsParameterFilter.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsParameterFilter.cs @@ -1,7 +1,7 @@ -using System.Linq; -using System.Reflection; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; +using System.Linq; +using System.Reflection; namespace Swashbuckle.AspNetCore.Annotations { diff --git a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsRequestBodyFilter.cs b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsRequestBodyFilter.cs index 9ec9e3536d..b59c802f42 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsRequestBodyFilter.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsRequestBodyFilter.cs @@ -1,7 +1,7 @@ -using System.Linq; -using System.Reflection; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; +using System.Linq; +using System.Reflection; namespace Swashbuckle.AspNetCore.Annotations { diff --git a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsSchemaFilter.cs b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsSchemaFilter.cs index 85c36c8913..6d8290aef8 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsSchemaFilter.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsSchemaFilter.cs @@ -1,10 +1,10 @@ -using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; namespace Swashbuckle.AspNetCore.Annotations { diff --git a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsSwaggerGenOptionsExtensions.cs b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsSwaggerGenOptionsExtensions.cs index 38f6c95b11..e50bc4ae79 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/AnnotationsSwaggerGenOptionsExtensions.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/AnnotationsSwaggerGenOptionsExtensions.cs @@ -1,8 +1,8 @@ -using System; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using System; using System.Collections.Generic; using System.Linq; -using Swashbuckle.AspNetCore.SwaggerGen; -using Swashbuckle.AspNetCore.Annotations; namespace Microsoft.Extensions.DependencyInjection { diff --git a/src/Swashbuckle.AspNetCore.Annotations/SwaggerParameterAttribute.cs b/src/Swashbuckle.AspNetCore.Annotations/SwaggerParameterAttribute.cs index 5eaaddc97e..ce560c74c7 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/SwaggerParameterAttribute.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/SwaggerParameterAttribute.cs @@ -17,7 +17,7 @@ public SwaggerParameterAttribute(string description = null) /// A brief description of the parameter. This could contain examples of use. /// GFM syntax can be used for rich text representation /// - public string Description { get; set; } + public string Description { get; set; } /// /// Determines whether the parameter is mandatory. If the parameter is in "path", diff --git a/src/Swashbuckle.AspNetCore.Annotations/SwaggerRequestBodyAttribute.cs b/src/Swashbuckle.AspNetCore.Annotations/SwaggerRequestBodyAttribute.cs index 1a9127f22b..b5c76467d3 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/SwaggerRequestBodyAttribute.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/SwaggerRequestBodyAttribute.cs @@ -17,7 +17,7 @@ public SwaggerRequestBodyAttribute(string description = null) /// A brief description of the requestBody. This could contain examples of use. /// GFM syntax can be used for rich text representation /// - public string Description { get; set; } + public string Description { get; set; } /// /// Determines whether the requestBody is mandatory. If the parameter is in "path", diff --git a/src/Swashbuckle.AspNetCore.Annotations/SwaggerResponseAttribute.cs b/src/Swashbuckle.AspNetCore.Annotations/SwaggerResponseAttribute.cs index 501471f395..288ea6101c 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/SwaggerResponseAttribute.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/SwaggerResponseAttribute.cs @@ -1,5 +1,5 @@ -using System; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; +using System; namespace Swashbuckle.AspNetCore.Annotations { diff --git a/src/Swashbuckle.AspNetCore.Annotations/SwaggerSchemaFilterAttribute.cs b/src/Swashbuckle.AspNetCore.Annotations/SwaggerSchemaFilterAttribute.cs index b8c73cf7f3..8b9a8455b0 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/SwaggerSchemaFilterAttribute.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/SwaggerSchemaFilterAttribute.cs @@ -8,7 +8,7 @@ public class SwaggerSchemaFilterAttribute : Attribute public SwaggerSchemaFilterAttribute(Type type) { Type = type; - Arguments = new object[]{ }; + Arguments = new object[] { }; } public Type Type { get; private set; } diff --git a/src/Swashbuckle.AspNetCore.Annotations/SwaggerTagAttribute.cs b/src/Swashbuckle.AspNetCore.Annotations/SwaggerTagAttribute.cs index 030396afd2..801749d2ec 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/SwaggerTagAttribute.cs +++ b/src/Swashbuckle.AspNetCore.Annotations/SwaggerTagAttribute.cs @@ -21,7 +21,7 @@ public SwaggerTagAttribute(string description = null, string externalDocsUrl = n /// /// A short description for the tag. GFM syntax can be used for rich text representation. /// - public string Description { get; } + public string Description { get; } /// /// A URL for additional external documentation. Value MUST be in the format of a URL. diff --git a/src/Swashbuckle.AspNetCore.Annotations/Swashbuckle.AspNetCore.Annotations.csproj b/src/Swashbuckle.AspNetCore.Annotations/Swashbuckle.AspNetCore.Annotations.csproj index ca2496e5c6..aa903b6543 100644 --- a/src/Swashbuckle.AspNetCore.Annotations/Swashbuckle.AspNetCore.Annotations.csproj +++ b/src/Swashbuckle.AspNetCore.Annotations/Swashbuckle.AspNetCore.Annotations.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netcoreapp3.0 + net461 Swashbuckle.AspNetCore.Annotations true $(NoWarn);1591 @@ -15,6 +15,14 @@ https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/ApiTestFixture.cs b/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/ApiTestFixture.cs index d485239ab3..880dc30663 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/ApiTestFixture.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/ApiTestFixture.cs @@ -1,7 +1,7 @@ -using System.Net.Http; -using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.OpenApi.Models; +using System.Net.Http; +using System.Threading.Tasks; using Xunit; namespace Swashbuckle.AspNetCore.ApiTesting.Xunit diff --git a/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle - Backup.AspNetCore.ApiTesting.Xunit.csproj b/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle - Backup.AspNetCore.ApiTesting.Xunit.csproj new file mode 100644 index 0000000000..4caeffebf9 --- /dev/null +++ b/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle - Backup.AspNetCore.ApiTesting.Xunit.csproj @@ -0,0 +1,25 @@ + + + + Xunit add-on for Swagger/OpenAPI-driven integration testing APIs built on ASP.NET Core + net461 + $(NoWarn);1591 + true + Swashbuckle.AspNetCore.ApiTesting.Xunit + Swashbuckle.AspNetCore.ApiTesting.Xunit + swagger;openapi;test-first;spec-first;testing;aspnetcore;xunit + https://github.com/domaindrivendev/Swashbuckle.AspNetCore + git + https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git + true + + + + + + + + + + + diff --git a/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle.AspNetCore.ApiTesting.Xunit.csproj b/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle.AspNetCore.ApiTesting.Xunit.csproj index ac53f41e6a..cb333bae8b 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle.AspNetCore.ApiTesting.Xunit.csproj +++ b/src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle.AspNetCore.ApiTesting.Xunit.csproj @@ -2,7 +2,7 @@ Xunit add-on for Swagger/OpenAPI-driven integration testing APIs built on ASP.NET Core - netstandard2.0;netcoreapp3.0 + net461 $(NoWarn);1591 true Swashbuckle.AspNetCore.ApiTesting.Xunit @@ -19,6 +19,13 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerBase.cs b/src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerBase.cs index 6f6fff934c..63df80aafc 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerBase.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerBase.cs @@ -1,9 +1,9 @@ +using Microsoft.OpenApi.Models; +using Microsoft.OpenApi.Writers; using System; using System.IO; using System.Net.Http; using System.Threading.Tasks; -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Writers; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerOptions.cs b/src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerOptions.cs index d4c2c68d5f..f412238c7c 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerOptions.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerOptions.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using Microsoft.OpenApi.Models; +using System.Collections.Generic; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/HttpHeadersExtensions.cs b/src/Swashbuckle.AspNetCore.ApiTesting/HttpHeadersExtensions.cs index 0ec9170347..b70335dd0f 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/HttpHeadersExtensions.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/HttpHeadersExtensions.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Specialized; +using System.Collections.Specialized; using System.Net.Http.Headers; namespace Swashbuckle.AspNetCore.ApiTesting @@ -8,7 +7,7 @@ public static class HttpHeadersExtensions { internal static NameValueCollection ToNameValueCollection(this HttpHeaders httpHeaders) { - var headerNameValues = new NameValueCollection(); + var headerNameValues = new NameValueCollection(); foreach (var entry in httpHeaders) { headerNameValues.Add(entry.Key, string.Join(",", entry.Value)); diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/IContentValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/IContentValidator.cs index 7927c3916a..11e3fc47a2 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/IContentValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/IContentValidator.cs @@ -1,6 +1,6 @@ -using System; +using Microsoft.OpenApi.Models; +using System; using System.Net.Http; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonContentValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonContentValidator.cs index e1c53d1671..5166b44491 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonContentValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonContentValidator.cs @@ -1,8 +1,8 @@ -using System; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Linq; +using System; using System.Collections.Generic; using System.Net.Http; -using Microsoft.OpenApi.Models; -using Newtonsoft.Json.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/IJsonValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/IJsonValidator.cs index b76ce803c4..3b970ac282 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/IJsonValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/IJsonValidator.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +using System.Collections.Generic; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonAllOfValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonAllOfValidator.cs index 36680b3747..19c0f7113e 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonAllOfValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonAllOfValidator.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Linq; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using System.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { @@ -26,7 +26,7 @@ public bool Validate( var allOfArray = schema.AllOf.ToArray(); - for (int i=0;i subErrorMessages)) errorMessagesList.AddRange(subErrorMessages.Select(msg => $"{msg} (allOf[{i}])")); diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonAnyOfValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonAnyOfValidator.cs index c761a4069e..8187e8eced 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonAnyOfValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonAnyOfValidator.cs @@ -1,7 +1,7 @@ -using System.Linq; -using System.Collections.Generic; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using System.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { @@ -26,7 +26,7 @@ public bool Validate( var anyOfArray = schema.AnyOf.ToArray(); - for (int i=0;i subErrorMessages)) { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonArrayValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonArrayValidator.cs index f486fd5593..58b58a5845 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonArrayValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonArrayValidator.cs @@ -1,8 +1,17 @@ +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Linq; using System; -using System.Linq; using System.Collections.Generic; + +/* Unmerged change from project 'Swashbuckle.AspNetCore.ApiTesting (netcoreapp3.0)' +Before: using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +After: +using System.Collections.Generic; +using System.Linq; +*/ +using System.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonBooleanValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonBooleanValidator.cs index 11def7930d..69ba0c6e18 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonBooleanValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonBooleanValidator.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Linq; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using System.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonNullValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonNullValidator.cs index e17633a149..8ba29f5597 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonNullValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonNullValidator.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Linq; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using System.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonNumberValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonNumberValidator.cs index 4467ad9d02..2175b3344d 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonNumberValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonNumberValidator.cs @@ -1,7 +1,7 @@ -using System.Linq; -using System.Collections.Generic; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using System.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonObjectValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonObjectValidator.cs index 4cebb7c4d8..7e401a6716 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonObjectValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonObjectValidator.cs @@ -1,8 +1,17 @@ +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Linq; using System; -using System.Linq; using System.Collections.Generic; + +/* Unmerged change from project 'Swashbuckle.AspNetCore.ApiTesting (netcoreapp3.0)' +Before: using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +After: +using System.Collections.Generic; +using System.Linq; +*/ +using System.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonOneOfValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonOneOfValidator.cs index ba84807883..edb41358c8 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonOneOfValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonOneOfValidator.cs @@ -1,7 +1,7 @@ -using System.Linq; -using System.Collections.Generic; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using System.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { @@ -27,7 +27,7 @@ public bool Validate( var oneOfArray = schema.OneOf.ToArray(); int matched = 0; - for (int i=0;i subErrorMessages)) matched++; diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonStringValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonStringValidator.cs index bc65af5428..410cb393e1 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonStringValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonStringValidator.cs @@ -1,8 +1,8 @@ +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Linq; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; -using Microsoft.OpenApi.Models; -using Newtonsoft.Json.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonValidator.cs index cebffc5c6d..fe8281b7c1 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/JsonValidation/JsonValidator.cs @@ -1,7 +1,7 @@ -using System.Linq; -using System.Collections.Generic; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using System.Linq; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/OpenApiDocumentExtensions.cs b/src/Swashbuckle.AspNetCore.ApiTesting/OpenApiDocumentExtensions.cs index 350677e400..8bd3f0aeba 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/OpenApiDocumentExtensions.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/OpenApiDocumentExtensions.cs @@ -1,5 +1,5 @@ -using System; using Microsoft.OpenApi.Models; +using System; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/OpenApiSchemaExtensions.cs b/src/Swashbuckle.AspNetCore.ApiTesting/OpenApiSchemaExtensions.cs index ecd44e4a6b..a8ae0604a8 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/OpenApiSchemaExtensions.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/OpenApiSchemaExtensions.cs @@ -1,7 +1,7 @@ -using System; +using Microsoft.OpenApi.Models; +using System; using System.Linq; using System.Text; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/RequestValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/RequestValidator.cs index 5dbc18534b..a11b805d36 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/RequestValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/RequestValidator.cs @@ -1,13 +1,13 @@ -using System; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Routing.Template; +using Microsoft.OpenApi.Models; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Net.Http; using System.Web; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Routing; -using Microsoft.AspNetCore.Routing.Template; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/ResponseValidator.cs b/src/Swashbuckle.AspNetCore.ApiTesting/ResponseValidator.cs index 88c3e833d4..157a885198 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/ResponseValidator.cs +++ b/src/Swashbuckle.AspNetCore.ApiTesting/ResponseValidator.cs @@ -1,9 +1,9 @@ -using System; +using Microsoft.OpenApi.Models; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Net.Http; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.ApiTesting { diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle - Backup.AspNetCore.ApiTesting.csproj b/src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle - Backup.AspNetCore.ApiTesting.csproj new file mode 100644 index 0000000000..fbe2c6582d --- /dev/null +++ b/src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle - Backup.AspNetCore.ApiTesting.csproj @@ -0,0 +1,30 @@ + + + + Core components for Swagger/OpenAPI-driven integration testing APIs built on ASP.NET Core + net461 + $(NoWarn);1591 + true + Swashbuckle.AspNetCore.ApiTesting + Swashbuckle.AspNetCore.ApiTesting + swagger;openapi;test-first;spec-first;testing;aspnetcore + https://github.com/domaindrivendev/Swashbuckle.AspNetCore + git + https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git + + + + + + + + + + + + + + + + + diff --git a/src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle.AspNetCore.ApiTesting.csproj b/src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle.AspNetCore.ApiTesting.csproj index 069018e3b4..eed8a25801 100644 --- a/src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle.AspNetCore.ApiTesting.csproj +++ b/src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle.AspNetCore.ApiTesting.csproj @@ -2,7 +2,7 @@ Core components for Swagger/OpenAPI-driven integration testing APIs built on ASP.NET Core - netstandard2.0;netcoreapp3.0 + net461 $(NoWarn);1591 true Swashbuckle.AspNetCore.ApiTesting @@ -14,6 +14,13 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + @@ -27,4 +34,8 @@ + + + + diff --git a/src/Swashbuckle.AspNetCore.Cli/Program.cs b/src/Swashbuckle.AspNetCore.Cli/Program.cs index e542281200..41e9ef8331 100644 --- a/src/Swashbuckle.AspNetCore.Cli/Program.cs +++ b/src/Swashbuckle.AspNetCore.Cli/Program.cs @@ -1,15 +1,15 @@ -using System; -using System.Reflection; -using System.Diagnostics; -using System.IO; -using System.Runtime.Loader; -using System.Linq; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.OpenApi.Writers; using Swashbuckle.AspNetCore.Swagger; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore; -using Microsoft.Extensions.Hosting; +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.Loader; namespace Swashbuckle.AspNetCore.Cli { diff --git a/src/Swashbuckle.AspNetCore.Cli/Swashbuckle.AspNetCore.Cli.csproj b/src/Swashbuckle.AspNetCore.Cli/Swashbuckle.AspNetCore.Cli.csproj index 4ea7f51f3c..ef41368f56 100644 --- a/src/Swashbuckle.AspNetCore.Cli/Swashbuckle.AspNetCore.Cli.csproj +++ b/src/Swashbuckle.AspNetCore.Cli/Swashbuckle.AspNetCore.Cli.csproj @@ -2,7 +2,7 @@ Swashbuckle (Swagger) Command Line Tools - netcoreapp2.1;netcoreapp3.0;net5.0 + net461 Exe dotnet-swagger Swashbuckle.AspNetCore.Cli @@ -10,6 +10,16 @@ swagger + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + diff --git a/src/Swashbuckle.AspNetCore.Newtonsoft/DependencyInjection/NewtonsoftServiceCollectionExtensions.cs b/src/Swashbuckle.AspNetCore.Newtonsoft/DependencyInjection/NewtonsoftServiceCollectionExtensions.cs index fa02207884..bdc928c7be 100644 --- a/src/Swashbuckle.AspNetCore.Newtonsoft/DependencyInjection/NewtonsoftServiceCollectionExtensions.cs +++ b/src/Swashbuckle.AspNetCore.Newtonsoft/DependencyInjection/NewtonsoftServiceCollectionExtensions.cs @@ -1,10 +1,10 @@ -using System; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Extensions.Options; using Newtonsoft.Json; -using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.Newtonsoft; +using Swashbuckle.AspNetCore.SwaggerGen; +using System; namespace Microsoft.Extensions.DependencyInjection { diff --git a/src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/JsonPropertyExtensions.cs b/src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/JsonPropertyExtensions.cs index 1799376f30..52949cfe5d 100644 --- a/src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/JsonPropertyExtensions.cs +++ b/src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/JsonPropertyExtensions.cs @@ -1,7 +1,7 @@ -using System.Linq; -using System.Reflection; -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using System.Linq; +using System.Reflection; namespace Swashbuckle.AspNetCore.Newtonsoft { diff --git a/src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/NewtonsoftBehavior.cs b/src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/NewtonsoftBehavior.cs index 1cfc2838bd..d7a57cee13 100644 --- a/src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/NewtonsoftBehavior.cs +++ b/src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/NewtonsoftBehavior.cs @@ -1,11 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; using Swashbuckle.AspNetCore.SwaggerGen; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; namespace Swashbuckle.AspNetCore.Newtonsoft { @@ -183,26 +183,26 @@ public string Serialize(object value) private static readonly Dictionary> PrimitiveTypesAndFormats = new Dictionary> { - [ typeof(bool) ] = Tuple.Create(DataType.Boolean, (string)null), - [ typeof(byte) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(sbyte) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(short) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(ushort) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(int) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(uint) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(long) ] = Tuple.Create(DataType.Integer, "int64"), - [ typeof(ulong) ] = Tuple.Create(DataType.Integer, "int64"), - [ typeof(float) ] = Tuple.Create(DataType.Number, "float"), - [ typeof(double) ] = Tuple.Create(DataType.Number, "double"), - [ typeof(decimal) ] = Tuple.Create(DataType.Number, "double"), - [ typeof(byte[]) ] = Tuple.Create(DataType.String, "byte"), - [ typeof(string) ] = Tuple.Create(DataType.String, (string)null), - [ typeof(char) ] = Tuple.Create(DataType.String, (string)null), - [ typeof(DateTime) ] = Tuple.Create(DataType.String, "date-time"), - [ typeof(DateTimeOffset) ] = Tuple.Create(DataType.String, "date-time"), - [ typeof(Guid) ] = Tuple.Create(DataType.String, "uuid"), - [ typeof(Uri) ] = Tuple.Create(DataType.String, "uri"), - [ typeof(TimeSpan) ] = Tuple.Create(DataType.String, "date-span") + [typeof(bool)] = Tuple.Create(DataType.Boolean, (string)null), + [typeof(byte)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(sbyte)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(short)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(ushort)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(int)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(uint)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(long)] = Tuple.Create(DataType.Integer, "int64"), + [typeof(ulong)] = Tuple.Create(DataType.Integer, "int64"), + [typeof(float)] = Tuple.Create(DataType.Number, "float"), + [typeof(double)] = Tuple.Create(DataType.Number, "double"), + [typeof(decimal)] = Tuple.Create(DataType.Number, "double"), + [typeof(byte[])] = Tuple.Create(DataType.String, "byte"), + [typeof(string)] = Tuple.Create(DataType.String, (string)null), + [typeof(char)] = Tuple.Create(DataType.String, (string)null), + [typeof(DateTime)] = Tuple.Create(DataType.String, "date-time"), + [typeof(DateTimeOffset)] = Tuple.Create(DataType.String, "date-time"), + [typeof(Guid)] = Tuple.Create(DataType.String, "uuid"), + [typeof(Uri)] = Tuple.Create(DataType.String, "uri"), + [typeof(TimeSpan)] = Tuple.Create(DataType.String, "date-span") }; } } diff --git a/src/Swashbuckle.AspNetCore.Newtonsoft/Swashbuckle.AspNetCore.Newtonsoft.csproj b/src/Swashbuckle.AspNetCore.Newtonsoft/Swashbuckle.AspNetCore.Newtonsoft.csproj index 995264cb23..06f5f4e7b5 100644 --- a/src/Swashbuckle.AspNetCore.Newtonsoft/Swashbuckle.AspNetCore.Newtonsoft.csproj +++ b/src/Swashbuckle.AspNetCore.Newtonsoft/Swashbuckle.AspNetCore.Newtonsoft.csproj @@ -2,7 +2,7 @@ Swagger Generator opt-in component to support Newtonsoft.Json serializer behaviors - netstandard2.0;netcoreapp3.0 + net461 Swashbuckle.AspNetCore.Newtonsoft swagger;documentation;discovery;help;webapi;aspnet;aspnetcore;newtonsoft https://github.com/domaindrivendev/Swashbuckle.AspNetCore @@ -12,6 +12,15 @@ Swashbuckle.AspNetCore.Newtonsoft.snk + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/src/Swashbuckle.AspNetCore.ReDoc/ReDocBuilderExtensions.cs b/src/Swashbuckle.AspNetCore.ReDoc/ReDocBuilderExtensions.cs index 6386b9fb5a..67d9f96a95 100644 --- a/src/Swashbuckle.AspNetCore.ReDoc/ReDocBuilderExtensions.cs +++ b/src/Swashbuckle.AspNetCore.ReDoc/ReDocBuilderExtensions.cs @@ -1,7 +1,8 @@ -using System; +using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Swashbuckle.AspNetCore.ReDoc; +using System; namespace Microsoft.AspNetCore.Builder { diff --git a/src/Swashbuckle.AspNetCore.ReDoc/ReDocMiddleware.cs b/src/Swashbuckle.AspNetCore.ReDoc/ReDocMiddleware.cs index 2f158390ef..decdbd4bee 100644 --- a/src/Swashbuckle.AspNetCore.ReDoc/ReDocMiddleware.cs +++ b/src/Swashbuckle.AspNetCore.ReDoc/ReDocMiddleware.cs @@ -1,12 +1,4 @@ -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; @@ -14,6 +6,14 @@ using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Text.RegularExpressions; +using System.Threading.Tasks; #if NETCOREAPP3_0 using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IWebHostEnvironment; #endif @@ -50,7 +50,7 @@ public async Task Invoke(HttpContext httpContext) var path = httpContext.Request.Path.Value; // If the RoutePrefix is requested (with or without trailing slash), redirect to index URL - if (httpMethod == "GET" && Regex.IsMatch(path, $"^/?{Regex.Escape(_options.RoutePrefix)}/?$", RegexOptions.IgnoreCase)) + if (httpMethod == "GET" && Regex.IsMatch(path, $"^/?{Regex.Escape(_options.RoutePrefix)}/?$", RegexOptions.IgnoreCase)) { var indexUrl = httpContext.Request.GetEncodedUrl().TrimEnd('/') + "/index.html"; @@ -58,7 +58,7 @@ public async Task Invoke(HttpContext httpContext) return; } - if (httpMethod == "GET" && Regex.IsMatch(path, $"/{_options.RoutePrefix}/?index.html", RegexOptions.IgnoreCase)) + if (httpMethod == "GET" && Regex.IsMatch(path, $"/{_options.RoutePrefix}/?index.html", RegexOptions.IgnoreCase)) { await RespondWithIndexHtml(httpContext.Response); return; diff --git a/src/Swashbuckle.AspNetCore.ReDoc/ReDocOptionsExtensions.cs b/src/Swashbuckle.AspNetCore.ReDoc/ReDocOptionsExtensions.cs index e44b95c77a..29afe2aa50 100644 --- a/src/Swashbuckle.AspNetCore.ReDoc/ReDocOptionsExtensions.cs +++ b/src/Swashbuckle.AspNetCore.ReDoc/ReDocOptionsExtensions.cs @@ -1,5 +1,5 @@ -using System.Text; -using Swashbuckle.AspNetCore.ReDoc; +using Swashbuckle.AspNetCore.ReDoc; +using System.Text; namespace Microsoft.AspNetCore.Builder { diff --git a/src/Swashbuckle.AspNetCore.ReDoc/Swashbuckle.AspNetCore.ReDoc.csproj b/src/Swashbuckle.AspNetCore.ReDoc/Swashbuckle.AspNetCore.ReDoc.csproj index 7911ce11c4..409fa1b100 100644 --- a/src/Swashbuckle.AspNetCore.ReDoc/Swashbuckle.AspNetCore.ReDoc.csproj +++ b/src/Swashbuckle.AspNetCore.ReDoc/Swashbuckle.AspNetCore.ReDoc.csproj @@ -2,7 +2,7 @@ Middleware to expose an embedded version of ReDoc from an ASP.NET Core application - netstandard2.0;netcoreapp3.0 + net461 $(NoWarn);1591 true Swashbuckle.AspNetCore.ReDoc @@ -15,9 +15,18 @@ Swashbuckle.AspNetCore.ReDoc.snk + + 5 + + + + + + + + - @@ -31,4 +40,17 @@ + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/Swashbuckle.AspNetCore.Swagger/DependencyInjection/SwaggerBuilderExtensions.cs b/src/Swashbuckle.AspNetCore.Swagger/DependencyInjection/SwaggerBuilderExtensions.cs index 1436e984ee..b1116c9566 100644 --- a/src/Swashbuckle.AspNetCore.Swagger/DependencyInjection/SwaggerBuilderExtensions.cs +++ b/src/Swashbuckle.AspNetCore.Swagger/DependencyInjection/SwaggerBuilderExtensions.cs @@ -1,13 +1,7 @@ -using System; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using Microsoft.OpenApi.Writers; using Swashbuckle.AspNetCore.Swagger; +using System; #if NETCOREAPP3_0 diff --git a/src/Swashbuckle.AspNetCore.Swagger/ISwaggerProvider.cs b/src/Swashbuckle.AspNetCore.Swagger/ISwaggerProvider.cs index eaba415b72..b3af6527c7 100644 --- a/src/Swashbuckle.AspNetCore.Swagger/ISwaggerProvider.cs +++ b/src/Swashbuckle.AspNetCore.Swagger/ISwaggerProvider.cs @@ -1,7 +1,7 @@ -using System; +using Microsoft.OpenApi.Models; +using System; using System.Collections.Generic; using System.Linq; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.Swagger { @@ -19,6 +19,6 @@ public UnknownSwaggerDocument(string documentName, IEnumerable knownDocu : base(string.Format("Unknown Swagger document - \"{0}\". Known Swagger documents: {1}", documentName, string.Join(",", knownDocuments?.Select(x => $"\"{x}\"")))) - {} + { } } } \ No newline at end of file diff --git a/src/Swashbuckle.AspNetCore.Swagger/SwaggerEndpointOptions.cs b/src/Swashbuckle.AspNetCore.Swagger/SwaggerEndpointOptions.cs index 4c8acf4004..37d22ca170 100644 --- a/src/Swashbuckle.AspNetCore.Swagger/SwaggerEndpointOptions.cs +++ b/src/Swashbuckle.AspNetCore.Swagger/SwaggerEndpointOptions.cs @@ -1,8 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; using Microsoft.OpenApi.Models; +using System; +using System.Collections.Generic; namespace Swashbuckle.AspNetCore.Swagger { diff --git a/src/Swashbuckle.AspNetCore.Swagger/SwaggerMiddleware.cs b/src/Swashbuckle.AspNetCore.Swagger/SwaggerMiddleware.cs index da2ccd1f65..75626cb07e 100644 --- a/src/Swashbuckle.AspNetCore.Swagger/SwaggerMiddleware.cs +++ b/src/Swashbuckle.AspNetCore.Swagger/SwaggerMiddleware.cs @@ -1,15 +1,12 @@ -using System; -using System.Globalization; -using System.IO; -using System.Resources; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing.Template; -using Microsoft.Extensions.Primitives; using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Writers; +using System.Globalization; +using System.IO; +using System.Text; +using System.Threading.Tasks; namespace Swashbuckle.AspNetCore.Swagger { diff --git a/src/Swashbuckle.AspNetCore.Swagger/SwaggerOptions.cs b/src/Swashbuckle.AspNetCore.Swagger/SwaggerOptions.cs index 7c67aef443..d97814147d 100644 --- a/src/Swashbuckle.AspNetCore.Swagger/SwaggerOptions.cs +++ b/src/Swashbuckle.AspNetCore.Swagger/SwaggerOptions.cs @@ -1,7 +1,7 @@ -using System; -using System.Collections.Generic; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; using Microsoft.OpenApi.Models; +using System; +using System.Collections.Generic; namespace Swashbuckle.AspNetCore.Swagger { @@ -18,7 +18,7 @@ public SwaggerOptions() /// public string RouteTemplate { get; set; } = "swagger/{documentName}/swagger.{json|yaml}"; - + /// /// Return Swagger JSON in the V2 format rather than V3 /// diff --git a/src/Swashbuckle.AspNetCore.Swagger/Swashbuckle - Backup.AspNetCore.Swagger.csproj b/src/Swashbuckle.AspNetCore.Swagger/Swashbuckle - Backup.AspNetCore.Swagger.csproj new file mode 100644 index 0000000000..00b8a7ec77 --- /dev/null +++ b/src/Swashbuckle.AspNetCore.Swagger/Swashbuckle - Backup.AspNetCore.Swagger.csproj @@ -0,0 +1,30 @@ + + + + Middleware to expose Swagger JSON endpoints from APIs built on ASP.NET Core + net461 + $(NoWarn);1591 + true + Swashbuckle.AspNetCore.Swagger + Swashbuckle.AspNetCore.Swagger.snk + true + Swashbuckle.AspNetCore.Swagger + swagger;documentation;discovery;help;webapi;aspnet;aspnetcore + https://github.com/domaindrivendev/Swashbuckle.AspNetCore + git + https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git + + + + + + + + + + + + + + + diff --git a/src/Swashbuckle.AspNetCore.Swagger/Swashbuckle.AspNetCore.Swagger.csproj b/src/Swashbuckle.AspNetCore.Swagger/Swashbuckle.AspNetCore.Swagger.csproj index 99d39853e0..e960b7d5c1 100644 --- a/src/Swashbuckle.AspNetCore.Swagger/Swashbuckle.AspNetCore.Swagger.csproj +++ b/src/Swashbuckle.AspNetCore.Swagger/Swashbuckle.AspNetCore.Swagger.csproj @@ -2,7 +2,7 @@ Middleware to expose Swagger JSON endpoints from APIs built on ASP.NET Core - netstandard2.0;netcoreapp3.0 + net461 $(NoWarn);1591 true Swashbuckle.AspNetCore.Swagger @@ -13,9 +13,17 @@ https://github.com/domaindrivendev/Swashbuckle.AspNetCore git https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git + true + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + @@ -27,4 +35,9 @@ + + + + + diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSchemaGeneratorOptions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSchemaGeneratorOptions.cs index 6e138a9b2b..62c5669425 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSchemaGeneratorOptions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSchemaGeneratorOptions.cs @@ -1,8 +1,8 @@ -using System; -using System.Collections.Generic; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; +using System; +using System.Collections.Generic; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSwaggerGeneratorOptions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSwaggerGeneratorOptions.cs index 84e6fcb3a0..5cd574c517 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSwaggerGeneratorOptions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/ConfigureSwaggerGeneratorOptions.cs @@ -1,10 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; +using System; +using System.Collections.Generic; +using System.Linq; #if NETCOREAPP3_0 using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IWebHostEnvironment; diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/DocumentProvider.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/DocumentProvider.cs index 13f0828a50..e01ee5088b 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/DocumentProvider.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/DocumentProvider.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using Microsoft.Extensions.Options; +using Microsoft.Extensions.Options; using Microsoft.OpenApi.Writers; using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; namespace Microsoft.Extensions.ApiDescriptions { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/SwaggerGenOptionsExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/SwaggerGenOptionsExtensions.cs index 98e1ade8e3..ffeca78e0b 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/SwaggerGenOptionsExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/SwaggerGenOptionsExtensions.cs @@ -1,9 +1,9 @@ +using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; using System; using System.Collections.Generic; using System.Xml.XPath; -using Microsoft.OpenApi.Models; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Swashbuckle.AspNetCore.SwaggerGen; namespace Microsoft.Extensions.DependencyInjection { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/SwaggerGenServiceCollectionExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/SwaggerGenServiceCollectionExtensions.cs index c3b899896d..0c9ce21651 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/SwaggerGenServiceCollectionExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection/SwaggerGenServiceCollectionExtensions.cs @@ -1,11 +1,11 @@ -using System; -using System.Text.Json; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.ApiDescriptions; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; +using System; +using System.Text.Json; namespace Microsoft.Extensions.DependencyInjection { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/ISchemaFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/ISchemaFilter.cs index 884b370a48..646e289b60 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/ISchemaFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/ISchemaFilter.cs @@ -1,6 +1,6 @@ -using System; +using Microsoft.OpenApi.Models; +using System; using System.Reflection; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/ISerializerBehavior.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/ISerializerBehavior.cs index 5ce6a8e1c9..29bebf232d 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/ISerializerBehavior.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/ISerializerBehavior.cs @@ -128,7 +128,7 @@ public DataProperty( MemberInfo = memberInfo; } - public string Name { get; } + public string Name { get; } public bool IsRequired { get; } public bool IsNullable { get; } public bool IsReadOnly { get; } diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/MemberInfoExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/MemberInfoExtensions.cs index 96bda3b82a..7469bc458e 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/MemberInfoExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/MemberInfoExtensions.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; using System.Linq; using System.Reflection; -using Microsoft.AspNetCore.Mvc; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/OpenApiSchemaExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/OpenApiSchemaExtensions.cs index 1adfe07fb7..08a8a2ef90 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/OpenApiSchemaExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/OpenApiSchemaExtensions.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Microsoft.OpenApi.Models; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Microsoft.OpenApi.Models; using AnnotationsDataType = System.ComponentModel.DataAnnotations.DataType; namespace Swashbuckle.AspNetCore.SwaggerGen diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs index 80f6af5cf3..4f944ed079 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs @@ -1,4 +1,7 @@ -using System; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.OpenApi.Models; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; @@ -6,9 +9,6 @@ using System.Globalization; using System.Linq; using System.Reflection; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.SwaggerGen { @@ -410,13 +410,13 @@ private void ApplyMemberMetadata(OpenApiSchema schema, Type type, MemberInfo mem { var defaultAsJson = _serializerBehavior.Serialize(defaultValueAttribute.Value); schema.Default = OpenApiAnyFactory.CreateFromJson(defaultAsJson); // TODO: address assumption that serializer returns JSON - } + } var obsoleteAttribute = customAttributes.OfType().FirstOrDefault(); if (obsoleteAttribute != null) { schema.Deprecated = true; - } + } schema.ApplyValidationAttributes(customAttributes); } diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGeneratorOptions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGeneratorOptions.cs index 79bb748413..d2533e900f 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGeneratorOptions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGeneratorOptions.cs @@ -1,7 +1,7 @@ -using System; +using Microsoft.OpenApi.Models; +using System; using System.Collections.Generic; using System.Linq; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SystemTextJsonBehavior.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SystemTextJsonBehavior.cs index 2de3e3bcf7..fbd8c13d18 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SystemTextJsonBehavior.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SystemTextJsonBehavior.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -41,7 +42,7 @@ public DataContract GetDataContractForType(Type type) //Test to determine if the serializer will treat as string var serializeAsString = (enumValues.Length > 0) && Serialize(enumValues.GetValue(0)).StartsWith("\""); - var primitiveTypeAndFormat = serializeAsString + var primitiveTypeAndFormat = serializeAsString ? PrimitiveTypesAndFormats[typeof(string)] : PrimitiveTypesAndFormats[type.GetEnumUnderlyingType()]; @@ -134,7 +135,7 @@ private IEnumerable GetDataPropertiesFor(Type objectType, out Type return (property.IsPubliclyReadable() || property.IsPubliclyWritable()) && !(property.GetIndexParameters().Any()) && - !(property.HasAttribute()) && + !(property.HasAttribute()) && !(_serializerOptions.IgnoreReadOnlyProperties && !property.IsPubliclyWritable()); }) .OrderBy(property => property.DeclaringType.GetInheritanceChain().Length); @@ -143,7 +144,7 @@ private IEnumerable GetDataPropertiesFor(Type objectType, out Type foreach (var propertyInfo in applicableProperties) { - if (propertyInfo.HasAttribute() + if (propertyInfo.HasAttribute() && propertyInfo.PropertyType.IsConstructedFrom(typeof(IDictionary<,>), out Type constructedDictionary)) { extensionDataType = constructedDictionary.GenericTypeArguments[1]; @@ -169,30 +170,30 @@ private IEnumerable GetDataPropertiesFor(Type objectType, out Type public string Serialize(object value) { - return JsonSerializer.Serialize(value, _serializerOptions); + return System.Text.Json.JsonSerializer.Serialize(value, _serializerOptions); } private static readonly Dictionary> PrimitiveTypesAndFormats = new Dictionary> { - [ typeof(bool) ] = Tuple.Create(DataType.Boolean, (string)null), - [ typeof(byte) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(sbyte) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(short) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(ushort) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(int) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(uint) ] = Tuple.Create(DataType.Integer, "int32"), - [ typeof(long) ] = Tuple.Create(DataType.Integer, "int64"), - [ typeof(ulong) ] = Tuple.Create(DataType.Integer, "int64"), - [ typeof(float) ] = Tuple.Create(DataType.Number, "float"), - [ typeof(double) ] = Tuple.Create(DataType.Number, "double"), - [ typeof(decimal) ] = Tuple.Create(DataType.Number, "double"), - [ typeof(byte[]) ] = Tuple.Create(DataType.String, "byte"), - [ typeof(string) ] = Tuple.Create(DataType.String, (string)null), - [ typeof(char) ] = Tuple.Create(DataType.String, (string)null), - [ typeof(DateTime) ] = Tuple.Create(DataType.String, "date-time"), - [ typeof(DateTimeOffset) ] = Tuple.Create(DataType.String, "date-time"), - [ typeof(Guid) ] = Tuple.Create(DataType.String, "uuid"), - [ typeof(Uri) ] = Tuple.Create(DataType.String, "uri") + [typeof(bool)] = Tuple.Create(DataType.Boolean, (string)null), + [typeof(byte)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(sbyte)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(short)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(ushort)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(int)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(uint)] = Tuple.Create(DataType.Integer, "int32"), + [typeof(long)] = Tuple.Create(DataType.Integer, "int64"), + [typeof(ulong)] = Tuple.Create(DataType.Integer, "int64"), + [typeof(float)] = Tuple.Create(DataType.Number, "float"), + [typeof(double)] = Tuple.Create(DataType.Number, "double"), + [typeof(decimal)] = Tuple.Create(DataType.Number, "double"), + [typeof(byte[])] = Tuple.Create(DataType.String, "byte"), + [typeof(string)] = Tuple.Create(DataType.String, (string)null), + [typeof(char)] = Tuple.Create(DataType.String, (string)null), + [typeof(DateTime)] = Tuple.Create(DataType.String, "date-time"), + [typeof(DateTimeOffset)] = Tuple.Create(DataType.String, "date-time"), + [typeof(Guid)] = Tuple.Create(DataType.String, "uuid"), + [typeof(Uri)] = Tuple.Create(DataType.String, "uri") }; } } diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ApiDescriptionExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ApiDescriptionExtensions.cs index 9845e90cd5..7670a6596f 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ApiDescriptionExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ApiDescriptionExtensions.cs @@ -1,9 +1,9 @@ -using System; -using System.Linq; +using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Mvc.Controllers; +using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.AspNetCore.Mvc.Controllers; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ApiParameterDescriptionExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ApiParameterDescriptionExtensions.cs index 9215a6816e..e095754e59 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ApiParameterDescriptionExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ApiParameterDescriptionExtensions.cs @@ -1,11 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.ModelBinding; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IDocumentFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IDocumentFilter.cs index ecac182ba4..92deb71494 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IDocumentFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IDocumentFilter.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.OpenApi.Models; +using System.Collections.Generic; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IOperationFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IOperationFilter.cs index eb3d6820b6..4a55bd3e32 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IOperationFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IOperationFilter.cs @@ -1,6 +1,6 @@ -using System.Reflection; -using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.OpenApi.Models; +using System.Reflection; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IParameterFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IParameterFilter.cs index 32db63efcc..ac0fb5677f 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IParameterFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IParameterFilter.cs @@ -1,6 +1,6 @@ -using System.Reflection; -using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.OpenApi.Models; +using System.Reflection; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IRequestBodyFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IRequestBodyFilter.cs index cafb5e5685..dfe2132d39 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IRequestBodyFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/IRequestBodyFilter.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.OpenApi.Models; +using System.Collections.Generic; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ISchemaGenerator.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ISchemaGenerator.cs index a568292847..42fab2b6f4 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ISchemaGenerator.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/ISchemaGenerator.cs @@ -1,6 +1,6 @@ -using System; +using Microsoft.OpenApi.Models; +using System; using System.Reflection; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/OpenApiAnyFactory.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/OpenApiAnyFactory.cs index 3dee34d0f3..7186741ca7 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/OpenApiAnyFactory.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/OpenApiAnyFactory.cs @@ -1,8 +1,6 @@ -using System; -using System.Collections; +using Microsoft.OpenApi.Any; using System.Collections.Generic; using System.Text.Json; -using Microsoft.OpenApi.Any; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SchemaRepository.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SchemaRepository.cs index e729d63e12..83b3c1a80a 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SchemaRepository.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SchemaRepository.cs @@ -1,7 +1,7 @@ -using System; +using Microsoft.OpenApi.Models; +using System; using System.Collections.Generic; using System.Linq; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs index f6ca565357..0f3c99a8fd 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs @@ -1,14 +1,14 @@ -using System; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.Swagger; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Reflection; using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.AspNetCore.Mvc.ModelBinding; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.Swagger; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGeneratorOptions.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGeneratorOptions.cs index 642b1251d1..f08afd0ca7 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGeneratorOptions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGeneratorOptions.cs @@ -1,8 +1,8 @@ -using System; +using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.OpenApi.Models; +using System; using System.Collections.Generic; using System.Linq; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/Swashbuckle.AspNetCore.SwaggerGen.csproj b/src/Swashbuckle.AspNetCore.SwaggerGen/Swashbuckle.AspNetCore.SwaggerGen.csproj index 5249c10201..6f2c843713 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/Swashbuckle.AspNetCore.SwaggerGen.csproj +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/Swashbuckle.AspNetCore.SwaggerGen.csproj @@ -2,7 +2,7 @@ Swagger Generator for APIs built on ASP.NET Core - netstandard2.0;netcoreapp3.0 + net461 $(NoWarn);1591 true Swashbuckle.AspNetCore.SwaggerGen @@ -15,6 +15,18 @@ https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + @@ -29,4 +41,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsDocumentFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsDocumentFilter.cs index 4b4fa811bb..d00e59900f 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsDocumentFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsDocumentFilter.cs @@ -1,9 +1,9 @@ -using System.Xml.XPath; -using System.Linq; -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.OpenApi.Models; using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.XPath; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsOperationFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsOperationFilter.cs index 46522e0057..8a7ced4820 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsOperationFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsOperationFilter.cs @@ -1,7 +1,7 @@ -using System; +using Microsoft.OpenApi.Models; +using System; using System.Reflection; using System.Xml.XPath; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsParameterFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsParameterFilter.cs index 4e61d0838e..a7625d8e89 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsParameterFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsParameterFilter.cs @@ -1,6 +1,6 @@ -using System.Reflection; +using Microsoft.OpenApi.Models; +using System.Reflection; using System.Xml.XPath; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsRequestBodyFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsRequestBodyFilter.cs index a83ee2e902..286cb66086 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsRequestBodyFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsRequestBodyFilter.cs @@ -1,6 +1,6 @@ -using System.Reflection; +using Microsoft.OpenApi.Models; +using System.Reflection; using System.Xml.XPath; -using Microsoft.OpenApi.Models; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsSchemaFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsSchemaFilter.cs index e306379ba7..85cd924499 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsSchemaFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsSchemaFilter.cs @@ -1,7 +1,7 @@ -using System; -using System.Xml.XPath; +using Microsoft.OpenApi.Models; +using System; using System.Reflection; -using Microsoft.OpenApi.Models; +using System.Xml.XPath; namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIBuilderExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIBuilderExtensions.cs index e7ededd887..0d97fcb6ee 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIBuilderExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIBuilderExtensions.cs @@ -1,7 +1,8 @@ -using System; +using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Swashbuckle.AspNetCore.SwaggerUI; +using System; namespace Microsoft.AspNetCore.Builder { diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs index 3c8ce444a8..bcc69c5588 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs @@ -1,19 +1,19 @@ -using System.Reflection; -using System.Threading.Tasks; -using System.Text.RegularExpressions; -using System.Text; -using System.Collections.Generic; -using System.IO; -using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Extensions; +using Microsoft.AspNetCore.StaticFiles; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using Microsoft.Extensions.FileProviders; -using Microsoft.AspNetCore.StaticFiles; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Microsoft.AspNetCore.Http.Extensions; +using System.Text.RegularExpressions; +using System.Threading.Tasks; #if NETCOREAPP3_0 using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IWebHostEnvironment; @@ -51,7 +51,7 @@ public async Task Invoke(HttpContext httpContext) var path = httpContext.Request.Path.Value; // If the RoutePrefix is requested (with or without trailing slash), redirect to index URL - if (httpMethod == "GET" && Regex.IsMatch(path, $"^/?{Regex.Escape(_options.RoutePrefix)}/?$", RegexOptions.IgnoreCase)) + if (httpMethod == "GET" && Regex.IsMatch(path, $"^/?{Regex.Escape(_options.RoutePrefix)}/?$", RegexOptions.IgnoreCase)) { var indexUrl = httpContext.Request.GetEncodedUrl().TrimEnd('/') + "/index.html"; @@ -59,7 +59,7 @@ public async Task Invoke(HttpContext httpContext) return; } - if (httpMethod == "GET" && Regex.IsMatch(path, $"^/{Regex.Escape(_options.RoutePrefix)}/?index.html$", RegexOptions.IgnoreCase)) + if (httpMethod == "GET" && Regex.IsMatch(path, $"^/{Regex.Escape(_options.RoutePrefix)}/?index.html$", RegexOptions.IgnoreCase)) { await RespondWithIndexHtml(httpContext.Response); return; diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptions.cs b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptions.cs index d66d14083f..141e5becaf 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptions.cs @@ -1,8 +1,8 @@ using System; -using System.IO; -using System.Reflection; using System.Collections.Generic; +using System.IO; using System.Linq; +using System.Reflection; using System.Text.Json.Serialization; namespace Swashbuckle.AspNetCore.SwaggerUI @@ -33,7 +33,7 @@ public class SwaggerUIOptions /// /// Gets the JavaScript config object, represented as JSON, that will be passed to the SwaggerUI /// - public ConfigObject ConfigObject { get; set; } = new ConfigObject(); + public ConfigObject ConfigObject { get; set; } = new ConfigObject(); /// /// Gets the JavaScript config object, represented as JSON, that will be passed to the initOAuth method diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptionsExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptionsExtensions.cs index a5d057da03..472f6ff99a 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptionsExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptionsExtensions.cs @@ -1,8 +1,8 @@ -using System; -using System.Text; -using System.Linq; +using Swashbuckle.AspNetCore.SwaggerUI; +using System; using System.Collections.Generic; -using Swashbuckle.AspNetCore.SwaggerUI; +using System.Linq; +using System.Text; namespace Microsoft.AspNetCore.Builder { @@ -43,7 +43,7 @@ public static void InjectJavascript(this SwaggerUIOptions options, string path, public static void SwaggerEndpoint(this SwaggerUIOptions options, string url, string name) { var urls = new List(options.ConfigObject.Urls ?? Enumerable.Empty()); - urls.Add(new UrlDescriptor { Url = url, Name = name} ); + urls.Add(new UrlDescriptor { Url = url, Name = name }); options.ConfigObject.Urls = urls; } diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj b/src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj index 6cfb14529c..9dee6bf7c4 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj @@ -2,7 +2,7 @@ Middleware to expose an embedded version of the swagger-ui from an ASP.NET Core application - netstandard2.0;netcoreapp3.0 + net461 $(NoWarn);1591 true Swashbuckle.AspNetCore.SwaggerUI @@ -36,6 +36,19 @@ + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/Swashbuckle.AspNetCore/Swashbuckle.AspNetCore.csproj b/src/Swashbuckle.AspNetCore/Swashbuckle.AspNetCore.csproj index ac84fd5f39..47f277c009 100644 --- a/src/Swashbuckle.AspNetCore/Swashbuckle.AspNetCore.csproj +++ b/src/Swashbuckle.AspNetCore/Swashbuckle.AspNetCore.csproj @@ -3,7 +3,7 @@ Swagger tools for documenting APIs built on ASP.NET Core - netstandard2.0;netcoreapp3.0 + net461 Swashbuckle.AspNetCore swagger;documentation;discovery;help;webapi;aspnet;aspnetcore https://github.com/domaindrivendev/Swashbuckle.AspNetCore @@ -45,4 +45,11 @@ + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + From 68a73c56070fe88a6526d9b0587038da19bd2362 Mon Sep 17 00:00:00 2001 From: Ali AbuSaleh Date: Thu, 21 Jan 2021 12:58:45 +0200 Subject: [PATCH 2/2] solve conflict --- .../SwaggerGenerator/OpenApiAnyFactory.cs | 5 +++-- .../XmlComments/XmlCommentsSchemaFilter.cs | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/OpenApiAnyFactory.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/OpenApiAnyFactory.cs index 7186741ca7..0b7c78c3b7 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/OpenApiAnyFactory.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/OpenApiAnyFactory.cs @@ -1,6 +1,7 @@ -using Microsoft.OpenApi.Any; +using System.Text.Json; +using Microsoft.OpenApi.Any; using System.Collections.Generic; -using System.Text.Json; + namespace Swashbuckle.AspNetCore.SwaggerGen { diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsSchemaFilter.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsSchemaFilter.cs index 85cd924499..d49ccbd81c 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsSchemaFilter.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsSchemaFilter.cs @@ -1,8 +1,7 @@ -using Microsoft.OpenApi.Models; -using System; -using System.Reflection; +using System; using System.Xml.XPath; - +using Microsoft.OpenApi.Models; +using System.Reflection; namespace Swashbuckle.AspNetCore.SwaggerGen { public class XmlCommentsSchemaFilter : ISchemaFilter