From cba097556a57bce5a3304a9e57e6f57e67ba682b Mon Sep 17 00:00:00 2001 From: Albie Date: Sun, 19 Dec 2021 08:05:01 +0000 Subject: [PATCH] move to newtonsoft --- .../OnionFruit Country List Generator.run.xml | 38 +++++----- generator/Program.cs | 4 +- src/Converters/DateTimeConverter.cs | 25 ------- src/Converters/MillisecondEpochConverter.cs | 15 ++-- src/DragonFruit.OnionFruit.Api.csproj | 2 +- src/Objects/TorBridgeDetails.cs | 39 ++++++----- src/Objects/TorBridgeSummary.cs | 11 +-- src/Objects/TorClientConnectionHistory.cs | 9 ++- src/Objects/TorHistoryGraph.cs | 18 ++--- src/Objects/TorNodeBandwidthHistory.cs | 13 ++-- src/Objects/TorNodeOverloadRateLimit.cs | 15 ++-- src/Objects/TorRelayDetails.cs | 69 +++++++++---------- src/Objects/TorRelaySummary.cs | 13 ++-- src/Objects/TorStatusResponse.cs | 28 ++++---- tests/DragonFruit.OnionFruit.Api.Tests.csproj | 4 +- tests/OnionFruitApiTest.cs | 4 +- 16 files changed, 148 insertions(+), 159 deletions(-) delete mode 100644 src/Converters/DateTimeConverter.cs diff --git a/.run/OnionFruit Country List Generator.run.xml b/.run/OnionFruit Country List Generator.run.xml index 3790dbc..1622f92 100644 --- a/.run/OnionFruit Country List Generator.run.xml +++ b/.run/OnionFruit Country List Generator.run.xml @@ -1,20 +1,22 @@  - - + + \ No newline at end of file diff --git a/generator/Program.cs b/generator/Program.cs index 2fb7452..47302fe 100644 --- a/generator/Program.cs +++ b/generator/Program.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Bia.Countries.Iso3166; using DragonFruit.Data; -using DragonFruit.Data.Serializers.SystemJson; +using DragonFruit.Data.Serializers.Newtonsoft; using DragonFruit.OnionFruit.Api.Enums; using DragonFruit.OnionFruit.Api.Extensions; using DragonFruit.OnionFruit.Api.Objects; @@ -17,7 +17,7 @@ namespace DragonFruit.OnionFruit.Tools.CountryList { internal static class Program { - private static readonly ApiClient Client = new ApiClient(); + private static readonly ApiClient Client = new ApiClient(); private static async Task Main(string[] args) { diff --git a/src/Converters/DateTimeConverter.cs b/src/Converters/DateTimeConverter.cs deleted file mode 100644 index 6ab30b1..0000000 --- a/src/Converters/DateTimeConverter.cs +++ /dev/null @@ -1,25 +0,0 @@ -// OnionFruit API/Tooling Copyright DragonFruit Network -// Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details - -using System; -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace DragonFruit.OnionFruit.Api.Converters -{ - internal class DateTimeConverter : JsonConverter - { - public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var date = reader.GetString(); - return DateTime.Parse(date, CultureInfo.InvariantCulture); - } - - public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) - { - var date = value.ToString("yyyy-MM-dd hh:mm:ss"); - writer.WriteStringValue(date); - } - } -} diff --git a/src/Converters/MillisecondEpochConverter.cs b/src/Converters/MillisecondEpochConverter.cs index 42eb185..b766806 100644 --- a/src/Converters/MillisecondEpochConverter.cs +++ b/src/Converters/MillisecondEpochConverter.cs @@ -2,23 +2,22 @@ // Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details using System; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Converters { internal class MillisecondEpochConverter : JsonConverter { - public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override void WriteJson(JsonWriter writer, DateTime value, JsonSerializer serializer) { - var time = reader.GetInt64(); - return new DateTime(1970, 1, 1).AddMilliseconds(time); + var epoch = value.Subtract(new DateTime(1970, 1, 1)).TotalSeconds; + writer.WriteValue((int)epoch); } - public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) + public override DateTime ReadJson(JsonReader reader, Type objectType, DateTime existingValue, bool hasExistingValue, JsonSerializer serializer) { - var epoch = value.Subtract(new DateTime(1970, 1, 1)).TotalSeconds; - writer.WriteNumberValue((int)epoch); + var time = reader.ReadAsString(); + return new DateTime(1970, 1, 1).AddMilliseconds(long.Parse(time)); } } } diff --git a/src/DragonFruit.OnionFruit.Api.csproj b/src/DragonFruit.OnionFruit.Api.csproj index 6768dea..dcbb6c3 100644 --- a/src/DragonFruit.OnionFruit.Api.csproj +++ b/src/DragonFruit.OnionFruit.Api.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Objects/TorBridgeDetails.cs b/src/Objects/TorBridgeDetails.cs index eb5b6c8..13ff038 100644 --- a/src/Objects/TorBridgeDetails.cs +++ b/src/Objects/TorBridgeDetails.cs @@ -2,33 +2,34 @@ // Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details using System; -using System.Text.Json.Serialization; +using System.Runtime.Serialization; using DragonFruit.OnionFruit.Api.Converters; using DragonFruit.OnionFruit.Api.Enums; +using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Objects { [Serializable] + [DataContract] + [JsonObject(MemberSerialization.OptIn)] public class TorBridgeDetails { - [JsonPropertyName("nickname")] + [DataMember(Name = "nickname")] public string Nickname { get; set; } - [JsonPropertyName("hashed_fingerprint")] + [DataMember(Name = "hashed_fingerprint")] public string HashedFingerprint { get; set; } - [JsonPropertyName("first_seen")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "first_seen")] public DateTime FirstSeen { get; set; } - [JsonPropertyName("last_seen")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "last_seen")] public DateTime LastSeen { get; set; } /// /// Whether the Bridge is currently online /// - [JsonPropertyName("running")] + [DataMember(Name = "running")] public bool Running { get; set; } /// @@ -36,7 +37,7 @@ public class TorBridgeDetails /// public TorNodeFlags Flags { get; set; } - [JsonPropertyName("flags")] + [DataMember(Name = "flags")] public string[] RawFlags { get => NodeFlagConverter.ToString(Flags); @@ -46,44 +47,44 @@ public string[] RawFlags /// /// UTC DateTime the server was last restarted /// - [JsonPropertyName("last_restarted")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "last_restarted")] + public DateTime? LastRestarted { get; set; } /// /// Bandwidth, in bytes/sec, the server is capable of providing /// - [JsonPropertyName("advertised_bandwidth")] + [DataMember(Name = "advertised_bandwidth")] public long AdvertisedBandwidth { get; set; } /// - /// The Tor version and + /// The Tor version and /// - [JsonPropertyName("platform")] + [DataMember(Name = "platform")] public string Platform { get; set; } /// /// The version of Tor the server is running /// - [JsonPropertyName("version")] + [DataMember(Name = "version")] public string Version { get; set; } /// /// Whether the bridge is running a recommended version of Tor /// - [JsonPropertyName("recommended_version")] + [DataMember(Name = "recommended_version")] public bool RecommendedVersion { get; set; } /// /// The pluggable transport types this bridge supports /// - [JsonPropertyName("transports")] + [DataMember(Name = "transports")] public string[] Transports { get; set; } - [JsonPropertyName("or_addresses")] + [DataMember(Name = "or_addresses")] public string[] OrAddresses { get; set; } - [JsonPropertyName("bridgedb_distributor")] + [DataMember(Name = "bridgedb_distributor")] public string BridgeDbDistributor { get; set; } } } diff --git a/src/Objects/TorBridgeSummary.cs b/src/Objects/TorBridgeSummary.cs index 6fbbd23..d32a255 100644 --- a/src/Objects/TorBridgeSummary.cs +++ b/src/Objects/TorBridgeSummary.cs @@ -2,29 +2,32 @@ // Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details using System; -using System.Text.Json.Serialization; +using System.Runtime.Serialization; +using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Objects { [Serializable] + [DataContract] + [JsonObject(MemberSerialization.OptIn)] public class TorBridgeSummary { /// /// The relay nickname, represented as 1-19 chars /// - [JsonPropertyName("n")] + [DataMember(Name = "n")] public string Nickname { get; set; } /// /// SHA-1 hash of the bridge fingerprint /// - [JsonPropertyName("h")] + [DataMember(Name = "h")] public string Fingerprint { get; set; } /// /// Whether the relay was running at the last consensus /// - [JsonPropertyName("r")] + [DataMember(Name = "r")] public bool Running { get; set; } } } diff --git a/src/Objects/TorClientConnectionHistory.cs b/src/Objects/TorClientConnectionHistory.cs index 6b42cd8..1a20035 100644 --- a/src/Objects/TorClientConnectionHistory.cs +++ b/src/Objects/TorClientConnectionHistory.cs @@ -3,17 +3,20 @@ using System; using System.Collections.Generic; -using System.Text.Json.Serialization; +using System.Runtime.Serialization; +using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Objects { [Serializable] + [DataContract] + [JsonObject(MemberSerialization.OptIn)] public class TorClientConnectionHistory { - [JsonPropertyName("fingerprint")] + [DataMember(Name = "fingerprint")] public string Fingerprint { get; set; } - [JsonPropertyName("average_clients")] + [DataMember(Name = "average_clients")] public IReadOnlyDictionary Clients { get; set; } } } diff --git a/src/Objects/TorHistoryGraph.cs b/src/Objects/TorHistoryGraph.cs index c971d0d..82f20a2 100644 --- a/src/Objects/TorHistoryGraph.cs +++ b/src/Objects/TorHistoryGraph.cs @@ -4,23 +4,23 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text.Json.Serialization; -using DragonFruit.OnionFruit.Api.Converters; +using System.Runtime.Serialization; +using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Objects { [Serializable] + [DataContract] + [JsonObject(MemberSerialization.OptIn)] public class TorHistoryGraph { - [JsonPropertyName("first")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "first")] public DateTime Start { get; set; } - [JsonPropertyName("last")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "last")] public DateTime End { get; set; } - [JsonPropertyName("interval")] + [DataMember(Name = "interval")] public int IntervalSeconds { get; set; } /// @@ -32,13 +32,13 @@ public class TorHistoryGraph /// /// The scale factor each value needs to be multiplied by to get the original value /// - [JsonPropertyName("factor")] + [DataMember(Name = "factor")] public double ScaleFactor { get; set; } /// /// The normalised values, as sent by the api /// - [JsonPropertyName("values")] + [DataMember(Name = "values")] public int?[] NormalisedValues { get; set; } /// diff --git a/src/Objects/TorNodeBandwidthHistory.cs b/src/Objects/TorNodeBandwidthHistory.cs index 33b46b0..6435731 100644 --- a/src/Objects/TorNodeBandwidthHistory.cs +++ b/src/Objects/TorNodeBandwidthHistory.cs @@ -3,23 +3,26 @@ using System; using System.Collections.Generic; -using System.Text.Json.Serialization; +using System.Runtime.Serialization; +using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Objects { [Serializable] + [DataContract] + [JsonObject(MemberSerialization.OptIn)] public class TorNodeBandwidthHistory { - [JsonPropertyName("fingerprint")] + [DataMember(Name = "fingerprint")] public string Fingerprint { get; set; } - [JsonPropertyName("write_history")] + [DataMember(Name = "write_history")] public IReadOnlyDictionary WriteHistory { get; set; } - [JsonPropertyName("read_history")] + [DataMember(Name = "read_history")] public IReadOnlyDictionary ReadHistory { get; set; } - [JsonPropertyName("overload_ratelimits")] + [DataMember(Name = "overload_ratelimits")] public TorNodeOverloadRateLimit OverloadRateLimits { get; set; } } } diff --git a/src/Objects/TorNodeOverloadRateLimit.cs b/src/Objects/TorNodeOverloadRateLimit.cs index 147c6be..0215642 100644 --- a/src/Objects/TorNodeOverloadRateLimit.cs +++ b/src/Objects/TorNodeOverloadRateLimit.cs @@ -2,27 +2,30 @@ // Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details using System; -using System.Text.Json.Serialization; +using System.Runtime.Serialization; using DragonFruit.OnionFruit.Api.Converters; +using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Objects { [Serializable] + [DataContract] + [JsonObject(MemberSerialization.OptIn)] public class TorNodeOverloadRateLimit { - [JsonPropertyName("rate-limit")] + [DataMember(Name = "rate-limit")] public long RateLimit { get; set; } - [JsonPropertyName("burst-limit")] + [DataMember(Name = "burst-limit")] public long BurstLimit { get; set; } - [JsonPropertyName("write-count")] + [DataMember(Name = "write-count")] public int WriteCount { get; set; } - [JsonPropertyName("read-count")] + [DataMember(Name = "read-count")] public int ReadCount { get; set; } - [JsonPropertyName("timestamp")] + [DataMember(Name = "timestamp")] [JsonConverter(typeof(MillisecondEpochConverter))] public DateTime Timestamp { get; set; } } diff --git a/src/Objects/TorRelayDetails.cs b/src/Objects/TorRelayDetails.cs index b939212..29f9638 100644 --- a/src/Objects/TorRelayDetails.cs +++ b/src/Objects/TorRelayDetails.cs @@ -2,44 +2,43 @@ // Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details using System; -using System.Text.Json.Serialization; +using System.Runtime.Serialization; using DragonFruit.OnionFruit.Api.Converters; using DragonFruit.OnionFruit.Api.Enums; +using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Objects { [Serializable] + [DataContract] + [JsonObject(MemberSerialization.OptIn)] public class TorRelayDetails { - [JsonPropertyName("nickname")] + [DataMember(Name = "nickname")] public string Nickname { get; set; } - [JsonPropertyName("fingerprint")] + [DataMember(Name = "fingerprint")] public string Fingerprint { get; set; } - [JsonPropertyName("first_seen")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "first_seen")] public DateTime FirstSeen { get; set; } - [JsonPropertyName("last_seen")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "last_seen")] public DateTime LastSeen { get; set; } - [JsonPropertyName("last_changed_address_or_port")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "last_changed_address_or_port")] public DateTime LastChangedAddressOrPort { get; set; } /// /// the server was last restarted /// - [JsonPropertyName("last_restarted")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "last_restarted")] public DateTime? LastRestarted { get; set; } /// /// Whether the node is running /// - [JsonPropertyName("running")] + [DataMember(Name = "running")] public bool Running { get; set; } /// @@ -47,7 +46,7 @@ public class TorRelayDetails /// public TorNodeFlags Flags { get; set; } - [JsonPropertyName("flags")] + [DataMember(Name = "flags")] public string[] RawFlags { get => NodeFlagConverter.ToString(Flags); @@ -57,121 +56,121 @@ public string[] RawFlags /// /// The country the server is located in /// - [JsonPropertyName("country")] + [DataMember(Name = "country")] public string CountryCode { get; set; } /// /// The country name the server is located in /// - [JsonPropertyName("country_name")] + [DataMember(Name = "country_name")] public string CountryName { get; set; } /// /// The autonomous system identifier, as assigned to by IANA /// - [JsonPropertyName("as")] + [DataMember(Name = "as")] public string As { get; set; } /// /// The autonomous system name, as assigned to by IANA /// - [JsonPropertyName("as_name")] + [DataMember(Name = "as_name")] public string AsName { get; set; } /// /// Weight assigned to the relay that clients use in their path selection algorithm /// - [JsonPropertyName("consensus_weight")] + [DataMember(Name = "consensus_weight")] public long ConsensusWeight { get; set; } /// /// Bandwidth, in bytes/sec, that the server can handle over a long period of time /// - [JsonPropertyName("bandwidth_rate")] + [DataMember(Name = "bandwidth_rate")] public long? BandwidthRate { get; set; } /// /// Bandwidth, in bytes/sec, that the server can handle in a very short period of time (burst) /// - [JsonPropertyName("bandwidth_burst")] + [DataMember(Name = "bandwidth_burst")] public long? BandwidthBurst { get; set; } /// /// Bandwidth, in bytes/sec, that the server has provided based on the last 24 hours of activity /// - [JsonPropertyName("observed_bandwidth")] + [DataMember(Name = "observed_bandwidth")] public long? ObservedBandwidth { get; set; } /// /// Bandwidth, in bytes/sec, that the server can theoretically provide /// - [JsonPropertyName("advertised_bandwidth")] + [DataMember(Name = "advertised_bandwidth")] public long? AdvertisedBandwidth { get; set; } /// /// Exit policy lines /// - [JsonPropertyName("exit_policy")] + [DataMember(Name = "exit_policy")] public string[] ExitPolicy { get; set; } /// /// Contact info for the owner of the server /// - [JsonPropertyName("contact")] + [DataMember(Name = "contact")] public string Contact { get; set; } /// /// The currently running platform (Tor version and Operating System) /// - [JsonPropertyName("platform")] + [DataMember(Name = "platform")] public string Platform { get; set; } /// /// Tor software version running on the relay /// - [JsonPropertyName("version")] + [DataMember(Name = "version")] public string Version { get; set; } /// /// Likelihood this server will be selected as an entry node in a new circuit /// - [JsonPropertyName("guard_probability")] + [DataMember(Name = "guard_probability")] public double GuardProbability { get; set; } /// /// Likelihood this server will be selected as a middleman node in a new circuit /// - [JsonPropertyName("middle_probability")] + [DataMember(Name = "middle_probability")] public double MiddleProbability { get; set; } /// /// Likelihood this server will be selected as an exit node in a new circuit /// - [JsonPropertyName("exit_probability")] + [DataMember(Name = "exit_probability")] public double ExitProbability { get; set; } /// /// Whether the relay is running a recommended version of the Tor software /// - [JsonPropertyName("recommended_version")] + [DataMember(Name = "recommended_version")] public bool RecommendedVersion { get; set; } /// /// IPv4 address and TCP port where the relay accepts connections /// - [JsonPropertyName("dir_address")] + [DataMember(Name = "dir_address")] public string DirAddress { get; set; } - [JsonPropertyName("or_addresses")] + [DataMember(Name = "or_addresses")] public string[] OrAddresses { get; set; } - [JsonPropertyName("exit_addresses")] + [DataMember(Name = "exit_addresses")] public string[] ExitAddresses { get; set; } - [JsonPropertyName("verified_host_names")] + [DataMember(Name = "verified_host_names")] public string[] VerifiedHostNames { get; set; } - [JsonPropertyName("unverified_host_names")] + [DataMember(Name = "unverified_host_names")] public string[] UnverifiedHostNames { get; set; } } } diff --git a/src/Objects/TorRelaySummary.cs b/src/Objects/TorRelaySummary.cs index 5954adc..071397c 100644 --- a/src/Objects/TorRelaySummary.cs +++ b/src/Objects/TorRelaySummary.cs @@ -2,35 +2,38 @@ // Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details using System; -using System.Text.Json.Serialization; +using System.Runtime.Serialization; +using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Objects { [Serializable] + [DataContract] + [JsonObject(MemberSerialization.OptIn)] public class TorRelaySummary { /// /// The relay nickname, represented as 1-19 chars /// - [JsonPropertyName("n")] + [DataMember(Name = "n")] public string Nickname { get; set; } /// /// A 40 uppercase-hex identifier /// - [JsonPropertyName("f")] + [DataMember(Name = "f")] public string Fingerprint { get; set; } /// /// Array of IP addresses that the relay accepts routing connections at /// - [JsonPropertyName("a")] + [DataMember(Name = "a")] public string[] Addresses { get; set; } /// /// Whether the relay was running at the last consensus /// - [JsonPropertyName("r")] + [DataMember(Name = "r")] public bool Running { get; set; } } } diff --git a/src/Objects/TorStatusResponse.cs b/src/Objects/TorStatusResponse.cs index f37bbd3..e5594e7 100644 --- a/src/Objects/TorStatusResponse.cs +++ b/src/Objects/TorStatusResponse.cs @@ -2,8 +2,7 @@ // Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details using System; -using System.Text.Json.Serialization; -using DragonFruit.OnionFruit.Api.Converters; +using System.Runtime.Serialization; namespace DragonFruit.OnionFruit.Api.Objects { @@ -13,19 +12,19 @@ public class TorStatusResponse /// /// The current api protocol /// - [JsonPropertyName("version")] + [DataMember(Name = "version")] public string Version { get; set; } /// /// When not-null, indicates when the next major version will be deployed /// - [JsonPropertyName("next_major_version_scheduled")] + [DataMember(Name = "next_major_version_scheduled")] public DateTime? NextVersionScheduled { get; set; } /// /// Git revision of the software used to write this response. This is omitted if unknown. /// - [JsonPropertyName("build_revision")] + [DataMember(Name = "build_revision")] public string BuildRevision { get; set; } /// @@ -34,23 +33,22 @@ public class TorStatusResponse /// /// Indicates how recent the relay objects in this document are. /// - [JsonPropertyName("relays_published")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "relays_published")] public DateTime RelaysPublished { get; set; } /// /// Numbers of relays skipped, if an offset was requested /// - [JsonPropertyName("relays_skipped")] + [DataMember(Name = "relays_skipped")] public int? RelaysSkipped { get; set; } - [JsonPropertyName("relays")] + [DataMember(Name = "relays")] public TRelay[] Relays { get; set; } /// /// Number of relays omitted due to user page limiting /// - [JsonPropertyName("relays_truncated")] + [DataMember(Name = "relays_truncated")] public int RelaysTruncated { get; set; } /// @@ -59,27 +57,27 @@ public class TorStatusResponse /// /// Indicates how recent the relay objects in this document are. /// - [JsonPropertyName("bridges_published")] - [JsonConverter(typeof(DateTimeConverter))] + [DataMember(Name = "bridges_published")] public DateTime BridgesPublished { get; set; } /// /// Numbers of bridges skipped, if an offset was requested /// - [JsonPropertyName("bridges_skipped")] + [DataMember(Name = "bridges_skipped")] public int? BridgesSkipped { get; set; } - [JsonPropertyName("bridges")] + [DataMember(Name = "bridges")] public TBridge[] Bridges { get; set; } /// /// Number of bridges omitted due to user page limiting /// - [JsonPropertyName("bridges_truncated")] + [DataMember(Name = "bridges_truncated")] public int BridgesTruncated { get; set; } } [Serializable] + [DataContract] public class TorStatusResponse : TorStatusResponse { } diff --git a/tests/DragonFruit.OnionFruit.Api.Tests.csproj b/tests/DragonFruit.OnionFruit.Api.Tests.csproj index 8b361f6..c0ae659 100644 --- a/tests/DragonFruit.OnionFruit.Api.Tests.csproj +++ b/tests/DragonFruit.OnionFruit.Api.Tests.csproj @@ -7,9 +7,9 @@ - + - + diff --git a/tests/OnionFruitApiTest.cs b/tests/OnionFruitApiTest.cs index 0537bd5..37c5367 100644 --- a/tests/OnionFruitApiTest.cs +++ b/tests/OnionFruitApiTest.cs @@ -2,12 +2,12 @@ // Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details using DragonFruit.Data; -using DragonFruit.Data.Serializers.SystemJson; +using DragonFruit.Data.Serializers.Newtonsoft; namespace DragonFruit.OnionFruit.Api.Tests { public class OnionFruitApiTest { - protected static ApiClient Client { get; } = new ApiClient(); + protected static ApiClient Client { get; } = new ApiClient(); } }