From 569a5fdb7b8122284f412629877ab607ace4f26d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 23 Mar 2022 15:39:40 -0400 Subject: [PATCH 1/2] - maps decimal type to number in typescript --- .../Writers/TypeScript/TypeScriptConventionService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs b/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs index fc5b7a0025..e30fe11165 100644 --- a/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs +++ b/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs @@ -103,7 +103,7 @@ private string WriteInlineDeclaration(CodeType currentType, CodeElement targetEl public override string TranslateType(CodeType type) { return type.Name switch { - "integer" or "int64" or "float" or "double" or "byte" or "sbyte" => "number", + "integer" or "int64" or "float" or "double" or "byte" or "sbyte" or "decimal" => "number", "binary" => "string", "String" or "Object" or "Boolean" or "Void" or "string" or "object" or "boolean" or "void" => type.Name.ToFirstCharacterLowerCase(), // little casing hack _ => type.Name.ToFirstCharacterUpperCase() ?? "object", From 5755d4c845055960b184a2380d197252e6ce1940 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 23 Mar 2022 15:41:19 -0400 Subject: [PATCH 2/2] - adds a decimal typescript changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a951d9986..d82c7cc060 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Moving middleware from Graph core to kiota http. - Fixed a bug where errors would fail to deserialize for TypeScript. +- Fixed a bug where decimal types would not be mapped in TypeScript. - TypeScript adding index exporting models to fix #870. - Fixed a bug where JSON serialization would fail on nil properties in Go. - Move typescript core packages into Kiota-TypeScript repo and delete for Kiota repo.