Skip to content

Commit

Permalink
Merge pull request #4254 from microsoft/typescript/remove-async-suffi…
Browse files Browse the repository at this point in the history
…x-for-request-adapter-methods

remove async suffix for request adapter methods
  • Loading branch information
baywet authored Feb 27, 2024
2 parents 437045d + 9ee4b27 commit 0ee20dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 0ee20dc

Please sign in to comment.