Skip to content

Commit

Permalink
Merge pull request #3478 from microsoft/bugfix/SymbolCleanup
Browse files Browse the repository at this point in the history
Fixes symbol cleanup with single quote character
  • Loading branch information
andrueastman authored Oct 12, 2023
2 parents df0d79a + 205f553 commit f952038
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
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

- 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).

## [1.7.0] - 2023-10-05

Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static string ReplaceDotsWithSlashInNamespaces(this string? namespaced)
///<summary>
/// Cleanup regex that removes all special characters from ASCII 0-127
///</summary>
private static readonly Regex propertyCleanupRegex = new(@"[""\s!#$%&'()*,./:;<=>?@\[\]\\^`{}|~-](?<followingLetter>\w)?", RegexOptions.Compiled, Constants.DefaultRegexTimeout);
private static readonly Regex propertyCleanupRegex = new(@"[""\s!#$%&'()*,./:;<=>?@\[\]\\^`{}|~-](?<followingLetter>\w)?", RegexOptions.Compiled, Constants.DefaultRegexTimeout);
private const string CleanupGroupName = "followingLetter";
public static string CleanupSymbolName(this string? original)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void NamesDontDiffer_DoesntWriteEnumMember()
[InlineData("$", "Dollar")]
[InlineData("double", "Double")]
[InlineData("string", "String")]
[InlineData("Invalid lorem’s", "InvalidLoremS")]
public void WritesEnumWithSanitizedName(string symbol, string expected)
{
currentEnum.Flags = true;
Expand Down

0 comments on commit f952038

Please sign in to comment.