From d8b901cb58e329c859f5932ee2ede0467f93655b Mon Sep 17 00:00:00 2001 From: Javier Garrido Date: Wed, 1 Mar 2017 00:47:24 +0100 Subject: [PATCH] Updated Swashbuckle.Core package version to fix some bugs and decrease newtonsoft Json version requirements. --- .../Swashbuckle.OData.NuGetPackage.nuproj | 2 +- .../Swashbuckle.OData.Sample.csproj | 2 +- Swashbuckle.OData.Sample/packages.config | 4 ++-- Swashbuckle.OData.Tests/Swashbuckle.OData.Tests.csproj | 6 ++++-- Swashbuckle.OData.Tests/packages.config | 2 +- Swashbuckle.OData/ODataSwaggerDocsConfig.cs | 7 ++++--- Swashbuckle.OData/ODataSwaggerProvider.cs | 3 ++- Swashbuckle.OData/SwaggerProviderOptions.cs | 6 +++++- Swashbuckle.OData/Swashbuckle.OData.csproj | 10 ++++++---- Swashbuckle.OData/SwashbuckleOptions.cs | 3 +++ Swashbuckle.OData/app.config | 2 +- Swashbuckle.OData/packages.config | 4 ++-- 12 files changed, 32 insertions(+), 19 deletions(-) diff --git a/Swashbuckle.OData.NuGetPackage/Swashbuckle.OData.NuGetPackage.nuproj b/Swashbuckle.OData.NuGetPackage/Swashbuckle.OData.NuGetPackage.nuproj index 28d7864..e98704e 100644 --- a/Swashbuckle.OData.NuGetPackage/Swashbuckle.OData.NuGetPackage.nuproj +++ b/Swashbuckle.OData.NuGetPackage/Swashbuckle.OData.NuGetPackage.nuproj @@ -19,7 +19,7 @@ Swashbuckle.OData - 3.0.0 + 3.1.0 Swashbuckle.OData Richard Beauchamp Richard Beauchamp diff --git a/Swashbuckle.OData.Sample/Swashbuckle.OData.Sample.csproj b/Swashbuckle.OData.Sample/Swashbuckle.OData.Sample.csproj index 01b4105..a654c6e 100644 --- a/Swashbuckle.OData.Sample/Swashbuckle.OData.Sample.csproj +++ b/Swashbuckle.OData.Sample/Swashbuckle.OData.Sample.csproj @@ -96,7 +96,7 @@ True - ..\packages\Swashbuckle.Core.5.3.2\lib\net40\Swashbuckle.Core.dll + ..\packages\Swashbuckle.Core.5.5.3\lib\net40\Swashbuckle.Core.dll True diff --git a/Swashbuckle.OData.Sample/packages.config b/Swashbuckle.OData.Sample/packages.config index 89a8166..46408b7 100644 --- a/Swashbuckle.OData.Sample/packages.config +++ b/Swashbuckle.OData.Sample/packages.config @@ -17,7 +17,7 @@ - - + + \ No newline at end of file diff --git a/Swashbuckle.OData.Tests/Swashbuckle.OData.Tests.csproj b/Swashbuckle.OData.Tests/Swashbuckle.OData.Tests.csproj index 66d8763..fbc763a 100644 --- a/Swashbuckle.OData.Tests/Swashbuckle.OData.Tests.csproj +++ b/Swashbuckle.OData.Tests/Swashbuckle.OData.Tests.csproj @@ -116,7 +116,7 @@ True - ..\packages\Swashbuckle.Core.5.3.2\lib\net40\Swashbuckle.Core.dll + ..\packages\Swashbuckle.Core.5.5.3\lib\net40\Swashbuckle.Core.dll True @@ -209,7 +209,9 @@ PreserveNewest - + + Designer + diff --git a/Swashbuckle.OData.Tests/packages.config b/Swashbuckle.OData.Tests/packages.config index 661a782..dc5226f 100644 --- a/Swashbuckle.OData.Tests/packages.config +++ b/Swashbuckle.OData.Tests/packages.config @@ -27,5 +27,5 @@ - + \ No newline at end of file diff --git a/Swashbuckle.OData/ODataSwaggerDocsConfig.cs b/Swashbuckle.OData/ODataSwaggerDocsConfig.cs index b023307..dd30031 100644 --- a/Swashbuckle.OData/ODataSwaggerDocsConfig.cs +++ b/Swashbuckle.OData/ODataSwaggerDocsConfig.cs @@ -95,8 +95,8 @@ private static IEnumerable GetParameterMappers() internal SwashbuckleOptions GetSwashbuckleOptions() { AddGlobalDocumentFilters(); - AddODataDocumentFilters(); - + AddODataDocumentFilters(); + var swaggerProviderOptions = new SwaggerProviderOptions( _swaggerDocsConfig.GetFieldValue>("_versionSupportResolver"), _swaggerDocsConfig.GetFieldValue>("_schemes"), @@ -113,7 +113,8 @@ internal SwashbuckleOptions GetSwashbuckleOptions() _swaggerDocsConfig.GetFieldValue("_describeStringEnumsInCamelCase"), GetODataOperationFilters(), GetODataDocumentFilters(), - _swaggerDocsConfig.GetFieldValue, ApiDescription>>("_conflictingActionsResolver") + _swaggerDocsConfig.GetFieldValue, ApiDescription>>("_conflictingActionsResolver"), + _swaggerDocsConfig.GetFieldValue("_applyFiltersToAllSchemas") ); return new SwashbuckleOptions(swaggerProviderOptions); diff --git a/Swashbuckle.OData/ODataSwaggerProvider.cs b/Swashbuckle.OData/ODataSwaggerProvider.cs index f7192f2..a7dccae 100644 --- a/Swashbuckle.OData/ODataSwaggerProvider.cs +++ b/Swashbuckle.OData/ODataSwaggerProvider.cs @@ -46,7 +46,8 @@ public SwaggerDocument GetSwagger(string rootUrl, string apiVersion) swashbuckleOptions.IgnoreObsoleteProperties, swashbuckleOptions.SchemaIdSelector, swashbuckleOptions.DescribeAllEnumsAsStrings, - swashbuckleOptions.DescribeStringEnumsInCamelCase); + swashbuckleOptions.DescribeStringEnumsInCamelCase, + swashbuckleOptions.ApplyFiltersToAllSchemas); Info info; _config.GetApiVersions().TryGetValue(apiVersion, out info); diff --git a/Swashbuckle.OData/SwaggerProviderOptions.cs b/Swashbuckle.OData/SwaggerProviderOptions.cs index 9e94624..5279c35 100644 --- a/Swashbuckle.OData/SwaggerProviderOptions.cs +++ b/Swashbuckle.OData/SwaggerProviderOptions.cs @@ -23,7 +23,8 @@ public SwaggerProviderOptions( bool describeStringEnumsInCamelCase, IEnumerable operationFilters, IEnumerable documentFilters, - Func, ApiDescription> conflictingActionsResolver + Func, ApiDescription> conflictingActionsResolver, + bool applyFiltersToAllSchemas ) { VersionSupportResolver = versionSupportResolver; @@ -42,6 +43,7 @@ Func, ApiDescription> conflictingActionsResolver OperationFilters = operationFilters; DocumentFilters = documentFilters; ConflictingActionsResolver = conflictingActionsResolver; + ApplyFiltersToAllSchemas = applyFiltersToAllSchemas; } public Func VersionSupportResolver { get; private set; } @@ -75,5 +77,7 @@ Func, ApiDescription> conflictingActionsResolver public IEnumerable DocumentFilters { get; private set; } public Func, ApiDescription> ConflictingActionsResolver { get; private set; } + + public bool ApplyFiltersToAllSchemas { get; private set; } } } \ No newline at end of file diff --git a/Swashbuckle.OData/Swashbuckle.OData.csproj b/Swashbuckle.OData/Swashbuckle.OData.csproj index 40f783c..8a7595c 100644 --- a/Swashbuckle.OData/Swashbuckle.OData.csproj +++ b/Swashbuckle.OData/Swashbuckle.OData.csproj @@ -146,12 +146,12 @@ ..\packages\Microsoft.Spatial.7.0.0\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll True - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll True - ..\packages\Swashbuckle.Core.5.3.2\lib\net40\Swashbuckle.Core.dll + ..\packages\Swashbuckle.Core.5.5.2\lib\net40\Swashbuckle.Core.dll True @@ -234,7 +234,9 @@ - + + Designer + Designer diff --git a/Swashbuckle.OData/SwashbuckleOptions.cs b/Swashbuckle.OData/SwashbuckleOptions.cs index ff474c7..8f86655 100644 --- a/Swashbuckle.OData/SwashbuckleOptions.cs +++ b/Swashbuckle.OData/SwashbuckleOptions.cs @@ -28,6 +28,7 @@ public SwashbuckleOptions(SwaggerProviderOptions swaggerProviderOptions) OperationFilters = swaggerProviderOptions.OperationFilters ?? new List(); DocumentFilters = swaggerProviderOptions.DocumentFilters ?? new List(); ConflictingActionsResolver = swaggerProviderOptions.ConflictingActionsResolver; + ApplyFiltersToAllSchemas = swaggerProviderOptions.ApplyFiltersToAllSchemas; } public Func VersionSupportResolver { get; private set; } @@ -62,6 +63,8 @@ public SwashbuckleOptions(SwaggerProviderOptions swaggerProviderOptions) public Func, ApiDescription> ConflictingActionsResolver { get; private set; } + public bool ApplyFiltersToAllSchemas { get; private set; } + private static string DefaultSchemaIdSelector(Type type) { return type.FriendlyId(); diff --git a/Swashbuckle.OData/app.config b/Swashbuckle.OData/app.config index ac009d9..774a8bd 100644 --- a/Swashbuckle.OData/app.config +++ b/Swashbuckle.OData/app.config @@ -8,7 +8,7 @@ - + diff --git a/Swashbuckle.OData/packages.config b/Swashbuckle.OData/packages.config index 8bda59f..67fb6be 100644 --- a/Swashbuckle.OData/packages.config +++ b/Swashbuckle.OData/packages.config @@ -9,6 +9,6 @@ - - + + \ No newline at end of file