diff --git a/src/JsonParseNode.cs b/src/JsonParseNode.cs index bf56d6d..5fa6d11 100644 --- a/src/JsonParseNode.cs +++ b/src/JsonParseNode.cs @@ -218,8 +218,7 @@ public JsonParseNode(JsonElement node, KiotaJsonSerializationContext jsonSeriali { var rawValue = _jsonNode.GetString(); if(string.IsNullOrEmpty(rawValue)) return null; - - var type = typeof(T); + rawValue = ToEnumRawName(rawValue!); if (typeof(T).IsDefined(typeof(FlagsAttribute))) { @@ -240,7 +239,7 @@ public JsonParseNode(JsonElement node, KiotaJsonSerializationContext jsonSeriali return (T)(object)value; } else - return Enum.TryParse(rawValue, true,out var result) ? result : null; + return Enum.TryParse(rawValue, true, out var result) ? result : null; } ///