Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target net461 #1967

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// </summary>
public string Description { get; set; }
public string Description { get; set; }

/// <summary>
/// Determines whether the parameter is mandatory. If the parameter is in "path",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// </summary>
public string Description { get; set; }
public string Description { get; set; }

/// <summary>
/// Determines whether the requestBody is mandatory. If the parameter is in "path",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using System;

namespace Swashbuckle.AspNetCore.Annotations
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public SwaggerTagAttribute(string description = null, string externalDocsUrl = n
/// <summary>
/// A short description for the tag. GFM syntax can be used for rich text representation.
/// </summary>
public string Description { get; }
public string Description { get; }

/// <summary>
/// A URL for additional external documentation. Value MUST be in the format of a URL.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>net461</TargetFrameworks>
<AssemblyName>Swashbuckle.AspNetCore.Annotations</AssemblyName>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
Expand All @@ -15,6 +15,14 @@
<RepositoryUrl>https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="coverlet.collector" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Swashbuckle.AspNetCore.SwaggerGen\Swashbuckle.AspNetCore.SwaggerGen.csproj" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Swashbuckle.AspNetCore.ApiTesting.Xunit/ApiTestFixture.cs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Xunit add-on for Swagger/OpenAPI-driven integration testing APIs built on ASP.NET Core</Description>
<TargetFrameworks>net461</TargetFrameworks>
<NoWarn>$(NoWarn);1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Swashbuckle.AspNetCore.ApiTesting.Xunit</AssemblyName>
<PackageId>Swashbuckle.AspNetCore.ApiTesting.Xunit</PackageId>
<PackageTags>swagger;openapi;test-first;spec-first;testing;aspnetcore;xunit</PackageTags>
<PackageProjectUrl>https://github.com/domaindrivendev/Swashbuckle.AspNetCore</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git</RepositoryUrl>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Swashbuckle.AspNetCore.ApiTesting\Swashbuckle.AspNetCore.ApiTesting.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Xunit add-on for Swagger/OpenAPI-driven integration testing APIs built on ASP.NET Core</Description>
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>net461</TargetFrameworks>
<NoWarn>$(NoWarn);1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Swashbuckle.AspNetCore.ApiTesting.Xunit</AssemblyName>
Expand All @@ -19,6 +19,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="coverlet.collector" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerBase.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using Microsoft.OpenApi.Models;
using System.Collections.Generic;

namespace Swashbuckle.AspNetCore.ApiTesting
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Specialized;
using System.Collections.Specialized;
using System.Net.Http.Headers;

namespace Swashbuckle.AspNetCore.ApiTesting
Expand All @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/Swashbuckle.AspNetCore.ApiTesting/IContentValidator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using Microsoft.OpenApi.Models;
using System;
using System.Net.Http;
using Microsoft.OpenApi.Models;

namespace Swashbuckle.AspNetCore.ApiTesting
{
Expand Down
6 changes: 3 additions & 3 deletions src/Swashbuckle.AspNetCore.ApiTesting/JsonContentValidator.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using Microsoft.OpenApi.Models;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;

namespace Swashbuckle.AspNetCore.ApiTesting
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -26,7 +26,7 @@ public bool Validate(

var allOfArray = schema.AllOf.ToArray();

for (int i=0;i<allOfArray.Length;i++)
for (int i = 0; i < allOfArray.Length; i++)
{
if (!_jsonValidator.Validate(allOfArray[i], openApiDocument, instance, out IEnumerable<string> subErrorMessages))
errorMessagesList.AddRange(subErrorMessages.Select(msg => $"{msg} (allOf[{i}])"));
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -26,7 +26,7 @@ public bool Validate(

var anyOfArray = schema.AnyOf.ToArray();

for (int i=0;i<anyOfArray.Length;i++)
for (int i = 0; i < anyOfArray.Length; i++)
{
if (_jsonValidator.Validate(anyOfArray[i], openApiDocument, instance, out IEnumerable<string> subErrorMessages))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -27,7 +27,7 @@ public bool Validate(
var oneOfArray = schema.OneOf.ToArray();

int matched = 0;
for (int i=0;i<oneOfArray.Length;i++)
for (int i = 0; i < oneOfArray.Length; i++)
{
if (_jsonValidator.Validate(oneOfArray[i], openApiDocument, instance, out IEnumerable<string> subErrorMessages))
matched++;
Expand Down
Loading