Skip to content

Commit

Permalink
Fix errors on non-generic ASF
Browse files Browse the repository at this point in the history
  • Loading branch information
Citrinate committed Mar 11, 2024
1 parent 09c3934 commit 45c2f5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion BoosterManager/Boosters/BoosterPageResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal BoosterPageResponse(Bot bot, IDocument? boosterPage) {

IEnumerable<Steam.BoosterInfo>? enumerableBoosters;
try {
enumerableBoosters = JsonSerializer.Deserialize<IEnumerable<Steam.BoosterInfo>>(info.Value, new JsonSerializerOptions { NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString });
enumerableBoosters = JsonSerializer.Deserialize<IEnumerable<Steam.BoosterInfo>>(info.Value);
} catch (JsonException ex) {
Bot.ArchiLogger.LogGenericError(ex.Message);

Expand Down
13 changes: 7 additions & 6 deletions BoosterManager/Json.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ internal sealed class BoosterInfo {

[JsonInclude]
[JsonPropertyName("price")]
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
[JsonRequired]
internal uint Price { get; private init; }

Expand Down Expand Up @@ -118,22 +119,22 @@ internal sealed class MarketListingsResponse {
[JsonInclude]
[JsonPropertyName("listings")]
[JsonRequired]
internal JsonArray? Listings { get; private init; }
internal List<JsonNode>? Listings { get; private init; }

[JsonInclude]
[JsonPropertyName("listings_on_hold")]
[JsonRequired]
internal JsonArray? ListingsOnHold { get; private init; } = new();
internal List<JsonNode>? ListingsOnHold { get; private init; } = new();

[JsonInclude]
[JsonPropertyName("listings_to_confirm")]
[JsonRequired]
internal JsonArray ListingsToConfirm { get; private init; } = new();
internal List<JsonNode> ListingsToConfirm { get; private init; } = new();

[JsonInclude]
[JsonPropertyName("buy_orders")]
[JsonRequired]
internal JsonArray BuyOrders { get; private init; } = new();
internal List<JsonNode> BuyOrders { get; private init; } = new();

[JsonConstructor]
private MarketListingsResponse() { }
Expand Down Expand Up @@ -167,7 +168,7 @@ internal sealed class MarketHistoryResponse {

[JsonInclude]
[JsonPropertyName("events")]
internal JsonArray? Events { get; private init; }
internal List<JsonNode>? Events { get; private init; }

[JsonInclude]
[JsonPropertyName("purchases")]
Expand Down Expand Up @@ -232,7 +233,7 @@ internal sealed class InventoryHistoryResponse {

[JsonInclude]
[JsonPropertyName("apps")]
internal JsonArray Apps { get; private init; } = new();
internal List<JsonNode> Apps { get; private init; } = new();

[JsonInclude]
[JsonPropertyName("cursor")]
Expand Down

0 comments on commit 45c2f5d

Please sign in to comment.