From 25cfbdcee4e00e096a2c07bbbeed1ca06a19d61b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 8 Sep 2023 09:52:29 -0400 Subject: [PATCH] - fixes parameters names replacement regression --- CHANGELOG.md | 6 ++++++ .../http/middleware/ParametersNameDecodingHandler.java | 3 ++- gradle.properties | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ca99f607..b57843d76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +## [0.7.4] - 2023-09-08 + +### Fixed + +- Fixed a regression where query parameters name replacement would fail with group like regex syntax ($ sign) + ## [0.7.3] - 2023-09-04 ### Fixed diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java index d4da6b956..d5133c1dd 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/ParametersNameDecodingHandler.java @@ -5,6 +5,7 @@ import java.util.Objects; import java.util.AbstractMap.SimpleEntry; import java.util.Map.Entry; +import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -120,7 +121,7 @@ public static String decodeQueryParameters(@Nullable final String original, @Non for (final Entry symbolToReplace : symbolsToReplace) { for (final Entry queryParameter : toDecode) { - queryParameter.setValue(queryParameter.getValue().replaceAll("(?i)"+Pattern.quote(symbolToReplace.getKey()), symbolToReplace.getValue())); + queryParameter.setValue(queryParameter.getValue().replaceAll("(?i)"+Pattern.quote(symbolToReplace.getKey()), Matcher.quoteReplacement(symbolToReplace.getValue()))); } } diff --git a/gradle.properties b/gradle.properties index ae3d83dc2..1bd433784 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,7 @@ org.gradle.caching=true mavenGroupId = com.microsoft.kiota mavenMajorVersion = 0 mavenMinorVersion = 7 -mavenPatchVersion = 3 +mavenPatchVersion = 4 mavenArtifactSuffix = #These values are used to run functional tests