2026-10-04 11:03:14 +02:00
|
|
|
using System.Text.Json.Serialization;
|
2026-10-03 15:26:21 +02:00
|
|
|
|
|
|
|
|
using decePubClient.Models;
|
|
|
|
|
|
|
|
|
|
namespace decePubClient;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Source-generated JSON metadata for the client's own types, used first by SUtility.DefaultSerializer (HTTP) and by
|
2026-11-10 07:28:09 +01:00
|
|
|
/// Blazored.LocalStorage (Program.cs); PrivaPub.ClientModels' types come from ClientModelsJsonContext. A type missing
|
|
|
|
|
/// from both fails in Development and the pasture, and is reported on the console elsewhere. Names stay camelCase:
|
|
|
|
|
/// wwwroot/js/theme.js reads PublicCacheData.pageSettings straight from localStorage.
|
2026-10-03 15:26:21 +02:00
|
|
|
/// </summary>
|
|
|
|
|
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
|
|
|
|
IgnoreReadOnlyProperties = true)]
|
|
|
|
|
[JsonSerializable(typeof(PublicCacheData))]
|
|
|
|
|
[JsonSerializable(typeof(PageSettings))]
|
|
|
|
|
[JsonSerializable(typeof(AuthData))]
|
2026-10-04 11:03:14 +02:00
|
|
|
[JsonSerializable(typeof(FeedFilter))]
|
2026-10-05 01:23:18 +02:00
|
|
|
[JsonSerializable(typeof(PublicActionNotices))]
|
2026-10-04 11:03:14 +02:00
|
|
|
[JsonSerializable(typeof(ServerInfo))]
|
|
|
|
|
[JsonSerializable(typeof(List<ServerInfo>))]
|
2026-10-18 08:24:43 +02:00
|
|
|
[JsonSerializable(typeof(CustomEmojiCache))]
|
2026-10-18 09:50:46 +02:00
|
|
|
[JsonSerializable(typeof(PushDevice))]
|
2026-10-03 15:26:21 +02:00
|
|
|
[JsonSerializable(typeof(UploadMedia))]
|
|
|
|
|
[JsonSerializable(typeof(ValidationErrors))]
|
2026-10-17 03:21:59 +02:00
|
|
|
// recover/valid takes the code as a JSON string ([FromBody] string) and answers a JSON bool
|
|
|
|
|
[JsonSerializable(typeof(string))]
|
|
|
|
|
[JsonSerializable(typeof(bool))]
|
2026-10-03 15:26:21 +02:00
|
|
|
public partial class ClientJsonContext : JsonSerializerContext
|
|
|
|
|
{
|
|
|
|
|
}
|