-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue with bad json casting, switched to object
- Loading branch information
Showing
4 changed files
with
59 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// <auto-generated /> | ||
// | ||
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do: | ||
// | ||
// using Heroesprofile.Uploader.Common; | ||
// | ||
// var uploadResult = UploadResult.FromJson(jsonString); | ||
|
||
namespace Heroesprofile.Uploader.Common | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
using System.Globalization; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
public partial class UploadResult | ||
{ | ||
[JsonProperty("fingerprint")] | ||
public Guid Fingerprint { get; set; } | ||
|
||
[JsonProperty("replayID")] | ||
public int ReplayId { get; set; } | ||
|
||
[JsonProperty("status")] | ||
public string Status { get; set; } | ||
} | ||
|
||
public partial class UploadResult | ||
{ | ||
public static UploadResult FromJson(string json) => JsonConvert.DeserializeObject<UploadResult>(json, Heroesprofile.Uploader.Common.Converter.Settings); | ||
} | ||
|
||
public static class Serialize | ||
{ | ||
public static string ToJson(this UploadResult self) => JsonConvert.SerializeObject(self, Heroesprofile.Uploader.Common.Converter.Settings); | ||
} | ||
|
||
internal static class Converter | ||
{ | ||
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings { | ||
MetadataPropertyHandling = MetadataPropertyHandling.Ignore, | ||
DateParseHandling = DateParseHandling.None, | ||
Converters = | ||
{ | ||
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } | ||
}, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters