Skip to content

Commit

Permalink
Update csharp-netcore dependencies to the latest stable version (Open…
Browse files Browse the repository at this point in the history
…APITools#7194)

* update csharp-netcore dependencies

* update test sdk version

* set tests.sdk version to 15.9.2

* rearrange test

* vs 2019 image

* rollback to v4.61.0

* update Microsoft.NET.Test.Sdk version

* Revert "update Microsoft.NET.Test.Sdk version"

This reverts commit 7a86bfc.

* rollback Microsoft.NET.Test.Sdk
  • Loading branch information
wing328 authored Aug 17, 2020
1 parent e26a422 commit b7b0090
Show file tree
Hide file tree
Showing 15 changed files with 137 additions and 60 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: '{branch}-{build}'
image: Visual Studio 2017
image: Visual Studio 2019
hosts:
petstore.swagger.io: 127.0.0.1
install:
Expand Down Expand Up @@ -53,8 +53,8 @@ build_script:
- gradle -b modules\openapi-generator-gradle-plugin\samples\local-spec\build.gradle buildGoSdk --stacktrace
test_script:
# test c# API client (netcore)
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client
- nunit3-console samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor
# test c# API client (with PropertyChanged)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,27 @@ namespace {{packageName}}.Client
var existingDeserializer = req.JsonSerializer as IDeserializer;
if (existingDeserializer != null)
{
client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
client.AddHandler("application/json", () => existingDeserializer);
client.AddHandler("text/json", () => existingDeserializer);
client.AddHandler("text/x-json", () => existingDeserializer);
client.AddHandler("text/javascript", () => existingDeserializer);
client.AddHandler("*+json", () => existingDeserializer);
}
else
{
client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
var customDeserializer = new CustomJsonCodec(configuration);
client.AddHandler("application/json", () => customDeserializer);
client.AddHandler("text/json", () => customDeserializer);
client.AddHandler("text/x-json", () => customDeserializer);
client.AddHandler("text/javascript", () => customDeserializer);
client.AddHandler("*+json", () => customDeserializer);
}
client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
var xmlDeserializer = new XmlDeserializer();
client.AddHandler("application/xml", () => xmlDeserializer);
client.AddHandler("text/xml", () => xmlDeserializer);
client.AddHandler("*+xml", () => xmlDeserializer);
client.AddHandler("*", () => xmlDeserializer);
client.Timeout = configuration.Timeout;
Expand Down Expand Up @@ -454,14 +467,27 @@ namespace {{packageName}}.Client
var existingDeserializer = req.JsonSerializer as IDeserializer;
if (existingDeserializer != null)
{
client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
client.AddHandler("application/json", () => existingDeserializer);
client.AddHandler("text/json", () => existingDeserializer);
client.AddHandler("text/x-json", () => existingDeserializer);
client.AddHandler("text/javascript", () => existingDeserializer);
client.AddHandler("*+json", () => existingDeserializer);
}
else
{
client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
var customDeserializer = new CustomJsonCodec(configuration);
client.AddHandler("application/json", () => customDeserializer);
client.AddHandler("text/json", () => customDeserializer);
client.AddHandler("text/x-json", () => customDeserializer);
client.AddHandler("text/javascript", () => customDeserializer);
client.AddHandler("*+json", () => customDeserializer);
}
client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
var xmlDeserializer = new XmlDeserializer();
client.AddHandler("application/xml", () => xmlDeserializer);
client.AddHandler("text/xml", () => xmlDeserializer);
client.AddHandler("*+xml", () => xmlDeserializer);
client.AddHandler("*", () => xmlDeserializer);
client.Timeout = configuration.Timeout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap
<a name="dependencies"></a>
## Dependencies

- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.10.1 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.4 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later
{{#useCompareNetObjects}}
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
{{/useCompareNetObjects}}
{{#validatable}}
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.5.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
{{/validatable}}

The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@

<ItemGroup>
{{#useCompareNetObjects}}
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="CompareNETObjects" Version="4.61.0" />
{{/useCompareNetObjects}}
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="RestSharp" Version="106.10.1" />
<PackageReference Include="JsonSubTypes" Version="1.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="RestSharp" Version="106.11.4" />
{{#validatable}}
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
{{/validatable}}
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
<!-- Dependencies are automatically installed when the package is installed -->
<dependencies>

<dependency id="Newtonsoft.Json" version="12.0.1" />
<dependency id="RestSharp" version="106.10.1" />
<dependency id="Newtonsoft.Json" version="12.0.3" />
<dependency id="RestSharp" version="106.11.4" />
{{#useCompareNetObjects}}
<dependency id="CompareNETObjects" version="4.57.0" />
<dependency id="CompareNETObjects" version="4.61.0" />
{{/useCompareNetObjects}}
<dependency id="JsonSubTypes" version="1.5.2" />
<dependency id="JsonSubTypes" version="1.7.0" />
{{#validatable}}
<dependency id="System.ComponentModel.Annotations" version="4.5.0" />
<dependency id="System.ComponentModel.Annotations" version="4.7.0" />
{{/validatable}}

</dependencies>
Expand Down
10 changes: 5 additions & 5 deletions samples/client/petstore/csharp-netcore/OpenAPIClient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap
<a name="dependencies"></a>
## Dependencies

- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.10.1 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.5.0 or later
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.4 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later

The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ OpenAPI spec version: 1.0.0

<ItemGroup>
<ProjectReference Include="..\Org.OpenAPITools\Org.OpenAPITools.csproj">
<Name>Org.OpenAPITools</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="linux-logo.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,27 @@ private ApiResponse<T> Exec<T>(RestRequest req, IReadableConfiguration configura
var existingDeserializer = req.JsonSerializer as IDeserializer;
if (existingDeserializer != null)
{
client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
client.AddHandler("application/json", () => existingDeserializer);
client.AddHandler("text/json", () => existingDeserializer);
client.AddHandler("text/x-json", () => existingDeserializer);
client.AddHandler("text/javascript", () => existingDeserializer);
client.AddHandler("*+json", () => existingDeserializer);
}
else
{
client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
var customDeserializer = new CustomJsonCodec(configuration);
client.AddHandler("application/json", () => customDeserializer);
client.AddHandler("text/json", () => customDeserializer);
client.AddHandler("text/x-json", () => customDeserializer);
client.AddHandler("text/javascript", () => customDeserializer);
client.AddHandler("*+json", () => customDeserializer);
}

client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
var xmlDeserializer = new XmlDeserializer();
client.AddHandler("application/xml", () => xmlDeserializer);
client.AddHandler("text/xml", () => xmlDeserializer);
client.AddHandler("*+xml", () => xmlDeserializer);
client.AddHandler("*", () => xmlDeserializer);

client.Timeout = configuration.Timeout;

Expand Down Expand Up @@ -457,14 +470,27 @@ private ApiResponse<T> Exec<T>(RestRequest req, IReadableConfiguration configura
var existingDeserializer = req.JsonSerializer as IDeserializer;
if (existingDeserializer != null)
{
client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
client.AddHandler("application/json", () => existingDeserializer);
client.AddHandler("text/json", () => existingDeserializer);
client.AddHandler("text/x-json", () => existingDeserializer);
client.AddHandler("text/javascript", () => existingDeserializer);
client.AddHandler("*+json", () => existingDeserializer);
}
else
{
client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
var customDeserializer = new CustomJsonCodec(configuration);
client.AddHandler("application/json", () => customDeserializer);
client.AddHandler("text/json", () => customDeserializer);
client.AddHandler("text/x-json", () => customDeserializer);
client.AddHandler("text/javascript", () => customDeserializer);
client.AddHandler("*+json", () => customDeserializer);
}

client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
var xmlDeserializer = new XmlDeserializer();
client.AddHandler("application/xml", () => xmlDeserializer);
client.AddHandler("text/xml", () => xmlDeserializer);
client.AddHandler("*+xml", () => xmlDeserializer);
client.AddHandler("*", () => xmlDeserializer);

client.Timeout = configuration.Timeout;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="RestSharp" Version="106.10.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageReference Include="CompareNETObjects" Version="4.61.0" />
<PackageReference Include="JsonSubTypes" Version="1.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="RestSharp" Version="106.11.4" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap
<a name="dependencies"></a>
## Dependencies

- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.10.1 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.5.0 or later
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.4 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later

The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ OpenAPI spec version: 1.0.0
<EmbeddedResource Include="linux-logo.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
Expand Down
Loading

0 comments on commit b7b0090

Please sign in to comment.