Skip to content

Commit

Permalink
fix: type casting
Browse files Browse the repository at this point in the history
  • Loading branch information
rkodev committed Aug 19, 2024
1 parent ed4888d commit a69e620
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/TypeScript/CodeFunctionWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private void WriteDiscriminatorSwitchBlock(DiscriminatorInformation discriminato
{
writer.StartBlock($"case \"{mappedType.Key}\":");
var mappedTypeName = mappedType.Value.Name.ToFirstCharacterUpperCase();
writer.WriteLine($"{GetFunctionName(codeElement, mappedTypeName, CodeMethodKind.Serializer)}(writer, {paramName});");
writer.WriteLine($"{GetFunctionName(codeElement, mappedTypeName, CodeMethodKind.Serializer)}(writer, {paramName} as {mappedType.Value.AllTypes.First().Name.ToFirstCharacterUpperCase()});");
writer.WriteLine("break;");
writer.DecreaseIndent();
}
Expand Down

0 comments on commit a69e620

Please sign in to comment.