1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-22 22:15:17 -04:00

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

This commit is contained in:
ta264
2021-02-03 21:20:06 +00:00
committed by Qstick
parent e623efefd3
commit f03dfda2f0
42 changed files with 285 additions and 89 deletions
+2 -2
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 Radarr.Http.Extensions;
@@ -248,7 +248,7 @@ namespace Radarr.Http.REST
{
resource = Request.Body.FromJson<TResource>();
}
catch (JsonReaderException e)
catch (JsonException e)
{
throw new BadRequestException($"Invalid request body. {e.Message}");
}
+2 -2
View File
@@ -1,10 +1,10 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace Radarr.Http.REST
{
public abstract class RestResource
{
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public virtual int Id { get; set; }
[JsonIgnore]