foxcord/Foxcord/Serialization/JsonSerializerExtensions.cs
2024-09-03 00:07:12 +02:00

19 lines
No EOL
477 B
C#

using System.Text.Json;
using System.Text.Json.Serialization;
namespace Foxcord.Serialization;
public static class JsonSerializerExtensions
{
public static JsonSerializerOptions CreateSerializer()
{
var opts = new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
NumberHandling = JsonNumberHandling.AllowReadingFromString,
IncludeFields = true
};
return opts;
}
}