pleroma: add JsonConstructor attribs

This commit is contained in:
uwaa 2024-12-25 23:34:13 +00:00
parent e5273860a6
commit 02ddd4c918
10 changed files with 16 additions and 0 deletions

View file

@ -11,6 +11,11 @@ public class ASObject
[JsonPropertyName("id")]
public string ID { get; set; } = null!;
[JsonConstructor()]
internal ASObject()
{
}
public override string ToString() => ID;
public override bool Equals(object? obj) => Equals(obj as ASObject);

View file

@ -53,6 +53,7 @@ public class Account : ASObject
}
}
[JsonConstructor()]
internal Account()
{
}

View file

@ -10,6 +10,7 @@ public class AccountField
public DateTime? VerifiedAt { get; set; }
[JsonConstructor()]
internal AccountField()
{
}

View file

@ -50,6 +50,7 @@ public class Attachment
[JsonPropertyName("url")]
public string URL { get; set; } = null!;
[JsonConstructor()]
internal Attachment()
{
}

View file

@ -8,6 +8,7 @@ public class Context
[JsonPropertyName("descendants")]
public Status[] Descendants { get; set; } = null!;
[JsonConstructor()]
internal Context()
{
}

View file

@ -14,6 +14,7 @@ public class Hashtag
[JsonPropertyName("url")]
public string URL { get; set; } = null!;
[JsonConstructor()]
internal Hashtag()
{
}

View file

@ -28,6 +28,7 @@ public class Mention
[JsonPropertyName("username")]
public string Username { get; set; } = null!;
[JsonConstructor()]
internal Mention()
{
}

View file

@ -50,6 +50,7 @@ public class Relationship
[JsonPropertyName("subscribing")]
public bool Subscribing { get; set; }
[JsonConstructor()]
internal Relationship()
{
}

View file

@ -20,6 +20,7 @@ public class SearchResults
[JsonPropertyName("statuses")]
public Status[]? Statuses { get; set; }
[JsonConstructor()]
internal SearchResults()
{
}

View file

@ -140,6 +140,7 @@ public class Status : ASObject
[JsonIgnore]
public string Content => Pleroma?.Content?.Plain ?? HtmlContent;
[JsonConstructor()]
internal Status()
{
}
@ -170,6 +171,7 @@ public class PleromaStatusData
[JsonPropertyName("quote_id")]
public string? QuoteID { get; set; }
[JsonConstructor()]
internal PleromaStatusData()
{
}
@ -180,6 +182,7 @@ public class PleromaStatusContent
[JsonPropertyName("text/plain")]
public string Plain { get; set; } = null!;
[JsonConstructor()]
internal PleromaStatusContent()
{
}