mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
New: Use System.Text.Json for Nancy and SignalR
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user