New: Use System.Text.Json for Nancy and SignalR

This commit is contained in:
ta264
2021-02-10 21:52:48 +00:00
parent 16b3817202
commit d3e8c7e0c9
40 changed files with 378 additions and 88 deletions
+3 -3
View File
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using FluentValidation;
using FluentValidation.Results;
using Nancy;
using Nancy.Responses.Negotiation;
using Newtonsoft.Json;
using NzbDrone.Core.Datastore;
using Readarr.Http.Extensions;
@@ -248,9 +248,9 @@ namespace Readarr.Http.REST
{
resource = Request.Body.FromJson<TResource>();
}
catch (JsonReaderException ex)
catch (JsonException e)
{
throw new BadRequestException(ex.Message);
throw new BadRequestException(e.Message);
}
if (resource == null)
+2 -2
View File
@@ -1,10 +1,10 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace Readarr.Http.REST
{
public abstract class RestResource
{
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public int Id { get; set; }
[JsonIgnore]