Skip to content

Commit

Permalink
Merge pull request #131 from cibergarri/master
Browse files Browse the repository at this point in the history
Updated Swashbuckle.Core package version to fix some bugs and decreas…
  • Loading branch information
rbeauchamp authored Mar 2, 2017
2 parents 5b8fe6b + d8b901c commit a0ac55a
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Import Project="$(NuProjPath)\NuProj.props" Condition="Exists('$(NuProjPath)\NuProj.props')" />
<PropertyGroup Label="Configuration">
<Id>Swashbuckle.OData</Id>
<Version>3.0.0</Version>
<Version>3.1.0</Version>
<Title>Swashbuckle.OData</Title>
<Authors>Richard Beauchamp</Authors>
<Owners>Richard Beauchamp</Owners>
Expand Down
2 changes: 1 addition & 1 deletion Swashbuckle.OData.Sample/Swashbuckle.OData.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc, processorArchitecture=MSIL">
<HintPath>..\packages\Swashbuckle.Core.5.3.2\lib\net40\Swashbuckle.Core.dll</HintPath>
<HintPath>..\packages\Swashbuckle.Core.5.5.3\lib\net40\Swashbuckle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
4 changes: 2 additions & 2 deletions Swashbuckle.OData.Sample/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<package id="Microsoft.Spatial" version="7.0.0" targetFramework="net452" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
<package id="Swashbuckle" version="5.3.2" allowedVersions="[5.3.2]" targetFramework="net452" />
<package id="Swashbuckle.Core" allowedVersions="(,5.4.0)" version="5.3.2" targetFramework="net452" />
<package id="Swashbuckle" version="5.5.3" targetFramework="net452" />
<package id="Swashbuckle.Core" version="5.5.3" targetFramework="net452" />
<package id="WebActivatorEx" version="2.1.0" targetFramework="net452" />
</packages>
6 changes: 4 additions & 2 deletions Swashbuckle.OData.Tests/Swashbuckle.OData.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc, processorArchitecture=MSIL">
<HintPath>..\packages\Swashbuckle.Core.5.3.2\lib\net40\Swashbuckle.Core.dll</HintPath>
<HintPath>..\packages\Swashbuckle.Core.5.5.3\lib\net40\Swashbuckle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down Expand Up @@ -209,7 +209,9 @@
<None Include="swagger-2.0-schema.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Swashbuckle.OData.Sample\Swashbuckle.OData.Sample.csproj">
Expand Down
2 changes: 1 addition & 1 deletion Swashbuckle.OData.Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
<package id="OpenCover" version="4.6.519" targetFramework="net452" />
<package id="Owin" version="1.0" targetFramework="net452" />
<package id="ReportGenerator" version="2.4.3.0" targetFramework="net452" />
<package id="Swashbuckle.Core" allowedVersions="(,5.4.0)" version="5.3.2" targetFramework="net452" />
<package id="Swashbuckle.Core" allowedVersions="(5.5.2,)" version="5.5.3" targetFramework="net452" />
</packages>
7 changes: 4 additions & 3 deletions Swashbuckle.OData/ODataSwaggerDocsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ private static IEnumerable<IParameterMapper> GetParameterMappers()
internal SwashbuckleOptions GetSwashbuckleOptions()
{
AddGlobalDocumentFilters();
AddODataDocumentFilters();

AddODataDocumentFilters();
var swaggerProviderOptions = new SwaggerProviderOptions(
_swaggerDocsConfig.GetFieldValue<Func<ApiDescription, string, bool>>("_versionSupportResolver"),
_swaggerDocsConfig.GetFieldValue<IEnumerable<string>>("_schemes"),
Expand All @@ -113,7 +113,8 @@ internal SwashbuckleOptions GetSwashbuckleOptions()
_swaggerDocsConfig.GetFieldValue<bool>("_describeStringEnumsInCamelCase"),
GetODataOperationFilters(),
GetODataDocumentFilters(),
_swaggerDocsConfig.GetFieldValue<Func<IEnumerable<ApiDescription>, ApiDescription>>("_conflictingActionsResolver")
_swaggerDocsConfig.GetFieldValue<Func<IEnumerable<ApiDescription>, ApiDescription>>("_conflictingActionsResolver"),
_swaggerDocsConfig.GetFieldValue<bool>("_applyFiltersToAllSchemas")
);

return new SwashbuckleOptions(swaggerProviderOptions);
Expand Down
3 changes: 2 additions & 1 deletion Swashbuckle.OData/ODataSwaggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion Swashbuckle.OData/SwaggerProviderOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public SwaggerProviderOptions(
bool describeStringEnumsInCamelCase,
IEnumerable<IOperationFilter> operationFilters,
IEnumerable<IDocumentFilter> documentFilters,
Func<IEnumerable<ApiDescription>, ApiDescription> conflictingActionsResolver
Func<IEnumerable<ApiDescription>, ApiDescription> conflictingActionsResolver,
bool applyFiltersToAllSchemas
)
{
VersionSupportResolver = versionSupportResolver;
Expand All @@ -42,6 +43,7 @@ Func<IEnumerable<ApiDescription>, ApiDescription> conflictingActionsResolver
OperationFilters = operationFilters;
DocumentFilters = documentFilters;
ConflictingActionsResolver = conflictingActionsResolver;
ApplyFiltersToAllSchemas = applyFiltersToAllSchemas;
}

public Func<ApiDescription, string, bool> VersionSupportResolver { get; private set; }
Expand Down Expand Up @@ -75,5 +77,7 @@ Func<IEnumerable<ApiDescription>, ApiDescription> conflictingActionsResolver
public IEnumerable<IDocumentFilter> DocumentFilters { get; private set; }

public Func<IEnumerable<ApiDescription>, ApiDescription> ConflictingActionsResolver { get; private set; }

public bool ApplyFiltersToAllSchemas { get; private set; }
}
}
10 changes: 6 additions & 4 deletions Swashbuckle.OData/Swashbuckle.OData.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@
<HintPath>..\packages\Microsoft.Spatial.7.0.0\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc, processorArchitecture=MSIL">
<HintPath>..\packages\Swashbuckle.Core.5.3.2\lib\net40\Swashbuckle.Core.dll</HintPath>
<HintPath>..\packages\Swashbuckle.Core.5.5.2\lib\net40\Swashbuckle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down Expand Up @@ -234,7 +234,9 @@
<Compile Include="TagComparer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
Expand Down
3 changes: 3 additions & 0 deletions Swashbuckle.OData/SwashbuckleOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public SwashbuckleOptions(SwaggerProviderOptions swaggerProviderOptions)
OperationFilters = swaggerProviderOptions.OperationFilters ?? new List<IOperationFilter>();
DocumentFilters = swaggerProviderOptions.DocumentFilters ?? new List<IDocumentFilter>();
ConflictingActionsResolver = swaggerProviderOptions.ConflictingActionsResolver;
ApplyFiltersToAllSchemas = swaggerProviderOptions.ApplyFiltersToAllSchemas;
}

public Func<ApiDescription, string, bool> VersionSupportResolver { get; private set; }
Expand Down Expand Up @@ -62,6 +63,8 @@ public SwashbuckleOptions(SwaggerProviderOptions swaggerProviderOptions)

public Func<IEnumerable<ApiDescription>, ApiDescription> ConflictingActionsResolver { get; private set; }

public bool ApplyFiltersToAllSchemas { get; private set; }

private static string DefaultSchemaIdSelector(Type type)
{
return type.FriendlyId();
Expand Down
2 changes: 1 addition & 1 deletion Swashbuckle.OData/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
Expand Down
4 changes: 2 additions & 2 deletions Swashbuckle.OData/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<package id="Microsoft.OData.Core" version="7.0.0" targetFramework="net452" />
<package id="Microsoft.OData.Edm" version="7.0.0" targetFramework="net452" />
<package id="Microsoft.Spatial" version="7.0.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
<package id="Swashbuckle.Core" allowedVersions="(,5.4.0)" version="5.3.2" targetFramework="net452" />
<package id="Newtonsoft.Json" allowedVersions="[6.0.4,)" version="6.0.4" targetFramework="net452" />
<package id="Swashbuckle.Core" allowedVersions="[5.5.2,6.0.0)" version="5.5.2" targetFramework="net452" />
</packages>

0 comments on commit a0ac55a

Please sign in to comment.