From d2dfd0c6b8e62f6fbe48482e5e320a50123d61a1 Mon Sep 17 00:00:00 2001 From: koros Date: Tue, 27 Feb 2024 23:48:01 +0300 Subject: [PATCH 1/2] remove async suffix for request adapter methods --- .../Writers/TypeScript/CodeConstantWriter.cs | 10 +++++----- .../Writers/TypeScript/CodeConstantWriterTests.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs b/src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs index a3e0f9401b..bdcf9460ba 100644 --- a/src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs +++ b/src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs @@ -188,15 +188,15 @@ currentType.TypeDefinition is CodeClass definitionClass && } private string GetSendRequestMethodName(bool isVoid, bool isStream, bool isCollection, string returnType) { - if (isVoid) return "sendNoResponseContentAsync"; + if (isVoid) return "sendNoResponseContent"; if (isCollection) { - if (conventions.IsPrimitiveType(returnType)) return $"sendCollectionOfPrimitiveAsync"; - return $"sendCollectionAsync"; + if (conventions.IsPrimitiveType(returnType)) return $"sendCollectionOfPrimitive"; + return $"sendCollection"; } - if (isStream || conventions.IsPrimitiveType(returnType)) return $"sendPrimitiveAsync"; - return $"sendAsync"; + if (isStream || conventions.IsPrimitiveType(returnType)) return $"sendPrimitive"; + return $"send"; } private void WriteUriTemplateConstant(CodeConstant codeElement, LanguageWriter writer) diff --git a/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeConstantWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeConstantWriterTests.cs index f894b68970..d3210509d7 100644 --- a/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeConstantWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeConstantWriterTests.cs @@ -183,7 +183,7 @@ public void WritesRequestExecutorBodyForCollections() }); writer.Write(constant); var result = tw.ToString(); - Assert.Contains("sendCollectionAsync", result); + Assert.Contains("sendCollection", result); AssertExtensions.CurlyBracesAreClosed(result); } [Fact] From 9ee4b279d5174471547d9006493998ee06f9ed45 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 27 Feb 2024 16:07:29 -0500 Subject: [PATCH 2/2] - adds changelog entry for typescript async suffix removal Signed-off-by: Vincent Biret --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57601a4e2c..373ca86d2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- BREAKING - Removed the async suffix from request adapter methods in TypeScript. [microsoft/kiota-typescript#992](https://github.com/microsoft/kiota-typescript/issues/992) - Fixed mantis for bitwise enums in Go. [#3936](https://github.com/microsoft/kiota/issues/3936) - Keyword in enum names for go should not be escaped. [#2877](https://github.com/microsoft/kiota/issues/2877) - Generator method code reduction in Python. [#3695](https://github.com/microsoft/kiota/issues/3695)