diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c83603296..814663f9f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed bug where base64url types would not be generated properly in Java. - Fixed bug where symbol name cleanup would not work on forward single quotes characters [#3426](https://github.com/microsoft/kiota/issues/3426). - Fixed a bug where a "models" API path segment in the description would derail generation. [#3400](https://github.com/microsoft/kiota/issues/3400) +- Fix bug where import statements in typescript wasn't using import type notation for types that are erased at runtime. [#3190](https://github.com/microsoft/kiota/issues/3190) ## [1.7.0] - 2023-10-05 diff --git a/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs b/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs index 674a57ce1d..24acfba6cc 100644 --- a/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs +++ b/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs @@ -466,6 +466,7 @@ private static void CorrectMethodType(CodeMethod currentMethod) Name = AbstractionsPackageName, IsExternal = true, }, + IsErasable = true, // the import is used only for the type, not for the value })}, {"DateOnly", (string.Empty, new CodeUsing { Name = "DateOnly", @@ -473,6 +474,7 @@ private static void CorrectMethodType(CodeMethod currentMethod) Name = AbstractionsPackageName, IsExternal = true, }, + IsErasable = true, // the import is used only for the type, not for the value })}, {"TimeOnly", (string.Empty, new CodeUsing { Name = "TimeOnly", @@ -480,6 +482,7 @@ private static void CorrectMethodType(CodeMethod currentMethod) Name = AbstractionsPackageName, IsExternal = true, }, + IsErasable = true, // the import is used only for the type, not for the value })}, {"Guid", (string.Empty, new CodeUsing { Name = "Guid", @@ -487,6 +490,7 @@ private static void CorrectMethodType(CodeMethod currentMethod) Name = GuidPackageName, IsExternal = true, }, + IsErasable = true, // the import is used only for the type, not for the value })}, };