From c5d7b890ae7b197ecc2dc184d206cd8cdcad0182 Mon Sep 17 00:00:00 2001 From: LucHeart Date: Thu, 1 Feb 2024 04:54:15 +0100 Subject: [PATCH] Redo converter --- API/Utils/OneWayPolymorphicJsonConverter.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/API/Utils/OneWayPolymorphicJsonConverter.cs b/API/Utils/OneWayPolymorphicJsonConverter.cs index 3031c8a6..0e715551 100644 --- a/API/Utils/OneWayPolymorphicJsonConverter.cs +++ b/API/Utils/OneWayPolymorphicJsonConverter.cs @@ -5,8 +5,11 @@ namespace OpenShock.API.Utils; public class OneWayPolymorphicJsonConverter : JsonConverter { - public override bool CanConvert(Type typeToConvert) => false; - + public override bool CanConvert(Type typeToConvert) + { + return typeof(G) == typeToConvert; //.IsAssignableFrom(typeToConvert); + } + public override G Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => throw new NotSupportedException();