Narrow some types from object to JsonObject in C# models

This commit is contained in:
Rory&
2026-07-05 04:22:26 +02:00
parent c641b45e58
commit c79f584dc7
4 changed files with 16 additions and 12 deletions
@@ -1,6 +1,7 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace Spacebar.Models.Generic;
@@ -21,10 +22,10 @@ public class Member
public string? Avatar { get; set; }
[JsonPropertyName("avatar_decoration_data")]
public object? AvatarDecorationData { get; set; }
public JsonObject? AvatarDecorationData { get; set; }
[JsonPropertyName("collectibles")]
public object? Collectibles { get; set; }
public JsonObject? Collectibles { get; set; }
[JsonPropertyName("display_name_styles"), JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public DisplayNameStyle? DisplayNameStyles { get; set; }
@@ -1,5 +1,6 @@
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace Spacebar.Models.Generic;
@@ -23,16 +24,16 @@ public class PartialUser
public string? Avatar { get; set; }
[JsonPropertyName("avatar_decoration_data")]
public object? AvatarDecorationData { get; set; }
public JsonObject? AvatarDecorationData { get; set; }
[JsonPropertyName("collectibles")]
public object? Collectibles { get; set; }
public JsonObject? Collectibles { get; set; }
[JsonPropertyName("display_name_styles"), JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public DisplayNameStyle? DisplayNameStyles { get; set; }
[JsonPropertyName("primary_guild")]
public object? PrimaryGuild { get; set; }
public JsonObject? PrimaryGuild { get; set; }
[JsonPropertyName("bot")]
public bool? Bot { get; set; }