From 6a02f036f938810dfff3cfb115bcf6936a1086d8 Mon Sep 17 00:00:00 2001 From: bchavez Date: Thu, 28 Feb 2019 10:01:28 -0800 Subject: [PATCH] Re #53 and #52. Mark all CreatedAt/UpdatedAt as nullable to prevent deser exceptions. --- HISTORY.md | 3 +++ Source/Coinbase/Models/Objects.cs | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 22fbc55..0c952d4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,6 @@ +## v5.0.8 +* PR #53: Ensure all `.CreatedAt` and `.UpdatedAt` fields are nullable to prevent deserialization exception errors. + ## v5.0.7 * Issue #52: `Coinbase.Models.Account.CreatedAt`/`.UpdatedAt` now nullable to avoid JSON deserialization error when JSON response contains null for these fields. diff --git a/Source/Coinbase/Models/Objects.cs b/Source/Coinbase/Models/Objects.cs index 63a0480..f2f6f7b 100644 --- a/Source/Coinbase/Models/Objects.cs +++ b/Source/Coinbase/Models/Objects.cs @@ -140,10 +140,10 @@ public partial class Transaction : Entity public string Description { get; set; } [JsonProperty("created_at")] - public DateTimeOffset CreatedAt { get; set; } + public DateTimeOffset? CreatedAt { get; set; } [JsonProperty("updated_at")] - public DateTimeOffset UpdatedAt { get; set; } + public DateTimeOffset? UpdatedAt { get; set; } [JsonProperty("network")] public Network Network { get; set; } @@ -249,10 +249,10 @@ public partial class PaymentMethod : Entity public bool InstantSell { get; set; } [JsonProperty("created_at")] - public DateTimeOffset CreatedAt { get; set; } + public DateTimeOffset? CreatedAt { get; set; } [JsonProperty("updated_at")] - public DateTimeOffset UpdatedAt { get; set; } + public DateTimeOffset? UpdatedAt { get; set; } [JsonProperty("limits")] public JToken Limits { get; set; } @@ -319,10 +319,10 @@ public partial class Deposit : Entity public Money Subtotal { get; set; } [JsonProperty("created_at")] - public DateTimeOffset CreatedAt { get; set; } + public DateTimeOffset? CreatedAt { get; set; } [JsonProperty("updated_at")] - public DateTimeOffset UpdatedAt { get; set; } + public DateTimeOffset? UpdatedAt { get; set; } [JsonProperty("committed")] public bool Committed { get; set; } @@ -354,10 +354,10 @@ public partial class Withdrawal : Entity public Money Subtotal { get; set; } [JsonProperty("created_at")] - public DateTimeOffset CreatedAt { get; set; } + public DateTimeOffset? CreatedAt { get; set; } [JsonProperty("updated_at")] - public DateTimeOffset UpdatedAt { get; set; } + public DateTimeOffset? UpdatedAt { get; set; } [JsonProperty("committed")] public bool Committed { get; set; } @@ -663,10 +663,10 @@ public partial class Notification : Entity public JObject DeliveryResponse { get; set; } [JsonProperty("created_at")] - public DateTimeOffset CreatedAt { get; set; } + public DateTimeOffset? CreatedAt { get; set; } [JsonProperty("updated_at")] - public DateTimeOffset UpdatedAt { get; set; } + public DateTimeOffset? UpdatedAt { get; set; } [JsonProperty("additional_data")] public JObject AdditionalData { get; set; }