19 lines
477 B
C#
19 lines
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;
|
||
|
}
|
||
|
}
|