Skip to content
This repository was archived by the owner on May 7, 2020. It is now read-only.

Commit 21e792a

Browse files
committed
* Upgrade to RestSharp 106.6.10
* Upgrade to Newtonsoft.Json 12.0.2 Local nuget removed
1 parent 4a1a25e commit 21e792a

File tree

8 files changed

+28
-45
lines changed

8 files changed

+28
-45
lines changed

.nuget/NuGet.Config

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<activePackageSource>
4-
<add key="All" value="(Aggregate source)" />
5-
</activePackageSource>
6-
<packageSources>
7-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
8-
</packageSources>
3+
<packageSources>
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
</packageSources>
96
</configuration>

.nuget/NuGet.exe

-4.83 MB
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RestSharp.Newtonsoft.Json.Extensions
55

66
## Package status
77

8-
| Latest version | [![Nuget version](http://img.shields.io/badge/nuget-v1.0.2-blue.png)](https://www.nuget.org/packages/RestSharp.Newtonsoft.Json.Extensions/) |
8+
| Latest version | [![Nuget version](http://img.shields.io/badge/nuget-v1.0.3-blue.png)](https://www.nuget.org/packages/RestSharp.Newtonsoft.Json.Extensions/) |
99
| :------ | :------: |
1010
| **Dependencies** | [![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/nuget/RestSharp.Newtonsoft.Json.Extensions.svg)](https://libraries.io/nuget/RestSharp.Newtonsoft.Json.Extensions) |
1111

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25420.1
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29306.81
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp.Newtonsoft.Json.Extensions", "RestSharp.Newtonsoft.Json.Extensions\RestSharp.Newtonsoft.Json.Extensions.csproj", "{60AE39A8-BA8B-4375-BB90-1DDD1AAD8739}"
77
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{A17F7504-90A1-44CB-969E-D3A87DD25D14}"
9-
ProjectSection(SolutionItems) = preProject
10-
.nuget\NuGet.Config = .nuget\NuGet.Config
11-
.nuget\NuGet.exe = .nuget\NuGet.exe
12-
EndProjectSection
13-
EndProject
148
Global
159
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1610
Debug|Any CPU = Debug|Any CPU
@@ -25,4 +19,7 @@ Global
2519
GlobalSection(SolutionProperties) = preSolution
2620
HideSolutionNode = FALSE
2721
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {A96AF3C4-C2B4-49E1-B05D-541849AD401F}
24+
EndGlobalSection
2825
EndGlobal

RestSharp.Newtonsoft.Json.Extensions/NewtonsoftJsonSerializer.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using System;
2-
using System.IO;
3-
using Newtonsoft.Json;
1+
using Newtonsoft.Json;
42
using RestSharp.Deserializers;
53
using RestSharp.Serializers;
4+
using System;
5+
using System.IO;
66

77
namespace RestSharp.Newtonsoft.Json.Extensions
88
{
@@ -15,13 +15,13 @@ public class NewtonsoftJsonSerializer : ISerializer, IDeserializer
1515
{
1616
private static NewtonsoftJsonSerializer _default;
1717

18-
private readonly global::Newtonsoft.Json.JsonSerializer _serializer;
18+
private readonly JsonSerializer _serializer;
1919

2020
/// <summary>
2121
/// Initializes a new instance of the <see cref="NewtonsoftJsonSerializer"/> class.
2222
/// </summary>
2323
/// <param name="serializer">The serializer.</param>
24-
public NewtonsoftJsonSerializer(global::Newtonsoft.Json.JsonSerializer serializer)
24+
public NewtonsoftJsonSerializer(JsonSerializer serializer)
2525
{
2626
_serializer = serializer;
2727
}
@@ -40,20 +40,14 @@ public static NewtonsoftJsonSerializer Default
4040
if (_default != null)
4141
return _default;
4242

43-
_default = new NewtonsoftJsonSerializer(new global::Newtonsoft.Json.JsonSerializer
43+
_default = new NewtonsoftJsonSerializer(new JsonSerializer
4444
{
4545
NullValueHandling = NullValueHandling.Ignore
4646
});
4747

4848
return _default;
4949
}
50-
set
51-
{
52-
if (value == null)
53-
throw new NullReferenceException(nameof(value));
54-
55-
_default = value;
56-
}
50+
set => _default = value ?? throw new NullReferenceException(nameof(value));
5751
}
5852

5953
/// <summary>

RestSharp.Newtonsoft.Json.Extensions/RestClientExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ public static void UseNewtonsoftJsonDeserializer(this IRestClient client)
1313
{
1414
var deserializer = NewtonsoftJsonSerializer.Default;
1515

16-
client.AddHandler("application/json", deserializer);
17-
client.AddHandler("text/json", deserializer);
18-
client.AddHandler("text/x-json", deserializer);
19-
client.AddHandler("text/javascript", deserializer);
20-
client.AddHandler("*+json", deserializer);
16+
client.AddHandler("application/json", () => deserializer);
17+
client.AddHandler("text/json", () => deserializer);
18+
client.AddHandler("text/x-json", () => deserializer);
19+
client.AddHandler("text/javascript", () => deserializer);
20+
client.AddHandler("*+json", () => deserializer);
2121
}
2222
}
2323
}

RestSharp.Newtonsoft.Json.Extensions/RestSharp.Newtonsoft.Json.Extensions.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
<Product>Simplify</Product>
66
<Description>RestSharp extensions to use Newtonsoft.Json for serialization/deserialization</Description>
77
<Copyright>Licensed under LGPL</Copyright>
8-
<Version>1.0.2</Version>
8+
<Version>1.0.3</Version>
99
<PackageProjectUrl>https://github.com/i4004/RestSharp.Newtonsoft.Json.Extensions</PackageProjectUrl>
1010
<RepositoryUrl>https://github.com/i4004/RestSharp.Newtonsoft.Json.Extensions</RepositoryUrl>
11+
<PackageIconUrl>https://raw.githubusercontent.com/restsharp/RestSharp/master/restsharp.png</PackageIconUrl>
1112
<RepositoryType>GIT</RepositoryType>
1213
<PackageTags>JSON RestSharp</PackageTags>
1314
<PackageReleaseNotes>
14-
+ .NET Standard 2.0 support
15-
* Upgrade to RestSharp 106.2.2
16-
* Upgrade to Newtonsoft.Json 11.0.2
15+
* Upgrade to RestSharp 106.6.10
16+
* Upgrade to Newtonsoft.Json 12.0.2
1717
</PackageReleaseNotes>
1818
<OutputPath>bin\Any CPU\$(Configuration)\</OutputPath>
1919
<DocumentationFile>bin\Any CPU\$(Configuration)\$(TargetFramework)\RestSharp.Newtonsoft.Json.Extensions.xml</DocumentationFile>
2020
</PropertyGroup>
2121
<ItemGroup>
22-
<PackageReference Include="RestSharp" Version="106.2.2" />
23-
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
22+
<PackageReference Include="RestSharp" Version="106.6.10" />
23+
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
2424
</ItemGroup>
2525
</Project>

appveyor.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@ version: '{build}'
22

33
image: Visual Studio 2017
44

5-
branches:
6-
only:
7-
- master
8-
- develop
9-
105
skip_tags: true
116
clone_depth: 1
127

138
configuration: Release
149
platform: Any CPU
1510

1611
before_build:
17-
- cmd: '".nuget/NuGet.exe" restore RestSharp.Newtonsoft.Json.Extensions.sln'
12+
- nuget restore RestSharp.Newtonsoft.Json.Extensions.sln
1813

1914
build:
2015
publish_nuget: true

0 commit comments

Comments
 (0)