Sets JsonPropertyNames for JSON conversion on properties with altered names

This commit is contained in:
Serraniel 2023-01-29 01:18:22 +01:00
parent e5680743e6
commit b6f59a7733
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3
2 changed files with 16 additions and 2 deletions

View file

@ -1,4 +1,5 @@
using JpnCardsPokemonSdk.Client.Endpoints;
using System.Text.Json.Serialization;
using JpnCardsPokemonSdk.Client.Endpoints;
namespace JpnCardsPokemonSdk.Api;
@ -8,6 +9,7 @@ public class Card : EndpointObject
public int Id { get; set; }
[JsonPropertyName("setData")]
public Set? Set { get; set; }
public string[]? Types { get; set; }
@ -30,6 +32,7 @@ public class Card : EndpointObject
// TODO: Type of property is not documented. Has to be evaluated at a later time.
// public Resistance[]? Ressistences { get; set; }
[JsonPropertyName("retreatCost")]
public string[]? RetreatCosts { get; set; }
public int? ConvertedRetreadCost { get; set; }
@ -43,10 +46,15 @@ public class Card : EndpointObject
// TODO: Type of property is not documented. Has to be evaluated at a later time.
// public Legality[]? Legalities { get; set; }
public string? Artist { get; set; }
[JsonPropertyName("image_url")]
public string? ImageUrl { get; set; }
[JsonPropertyName("card_url")]
public string? CardUrl { get; set; }
[JsonPropertyName("sequenceNumber")]
public int Number { get; set; }
public string? PrintedNumber { get; set; }

View file

@ -1,4 +1,5 @@
using JpnCardsPokemonSdk.Client.Endpoints;
using System.Text.Json.Serialization;
using JpnCardsPokemonSdk.Client.Endpoints;
namespace JpnCardsPokemonSdk.Api;
@ -8,8 +9,10 @@ public class Set : EndpointObject
public int Id { get; set; }
[JsonPropertyName("source_url")]
public string? SourceUrl { get; set; }
[JsonPropertyName("image_url")]
public string? ImageUrl { get; set; }
public string? Language { get; set; }
@ -19,10 +22,13 @@ public class Set : EndpointObject
// TODO: According to documentation the property currently is not supported.
// public DateOnly? Date { get; set; }
[JsonPropertyName("card_count")]
public int TotalCardCount { get; set; }
[JsonPropertyName("printed_count")]
public int PrintedCardCount { get; set; }
[JsonPropertyName("set_code")]
public string? SetCode { get; set; }
public int Uuid { get; set; }