From 122a646d1d5cda0ddd7f980ad29897e1605f521a Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Fri, 29 Nov 2024 14:29:09 +0300 Subject: [PATCH] More experimental updates --- src/Kiota.Builder/Writers/Php/CodeMethodWriter.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Writers/Php/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/Php/CodeMethodWriter.cs index 969bdccd0b..81598a7508 100644 --- a/src/Kiota.Builder/Writers/Php/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/Php/CodeMethodWriter.cs @@ -491,7 +491,15 @@ private string GetDeserializationMethodName(CodeTypeBase propType, CodeMethod me // //CodeType codeType when conventions.PrimitiveTypes.Contains(codeType.Name.ToLowerInvariant()) => $"getCollectionOfPrimitiveValues([{conventions.TranslateType(propType)}::class, '{CreateDiscriminatorMethodName}'])", // _ => $"getCollectionOfPrimitiveValues([{conventions.TranslateType(propType)}::class, '{CreateDiscriminatorMethodName}'])" // }; - if (currentType.TypeDefinition != null && conventions.PrimitiveTypes.Contains(currentType.TypeDefinition.Name.ToLowerInvariant())) + if (currentType.TypeDefinition is null) + { + parseNodeMethod = "object"; + } + else if (conventions.PrimitiveTypes.Contains(currentType.TypeDefinition.Name.ToLowerInvariant())) + { + parseNodeMethod = currentType.TypeDefinition.Name.ToLowerInvariant(); + } + else if (conventions.CustomTypes.Contains(currentType.TypeDefinition.Name.ToLowerInvariant())) { parseNodeMethod = currentType.TypeDefinition.Name.ToLowerInvariant(); }