|
|
@@ -4,7 +4,7 @@ using System.Reflection; |
|
|
|
|
|
|
|
namespace Discord.Serialization.Json |
|
|
|
{ |
|
|
|
internal class DiscordJsonSerializer : JsonSerializer |
|
|
|
public class DiscordJsonSerializer : JsonSerializer |
|
|
|
{ |
|
|
|
private static readonly Lazy<DiscordJsonSerializer> _singleton = new Lazy<DiscordJsonSerializer>(); |
|
|
|
public static new DiscordJsonSerializer Global => _singleton.Value; |
|
|
@@ -14,6 +14,7 @@ namespace Discord.Serialization.Json |
|
|
|
AddConverter<API.Image, ImagePropertyConverter>(); |
|
|
|
AddConverter<long, Int53PropertyConverter>((type, prop) => prop?.GetCustomAttribute<Int53Attribute>() != null); |
|
|
|
AddConverter<ulong, UInt53PropertyConverter>((type, prop) => prop?.GetCustomAttribute<Int53Attribute>() != null); |
|
|
|
|
|
|
|
AddGenericConverter(typeof(API.EntityOrId<>), typeof(EntityOrIdPropertyConverter<>)); |
|
|
|
AddGenericConverter(typeof(Optional<>), typeof(OptionalPropertyConverter<>)); |
|
|
|
} |
|
|
|