Skip to content

Commit

Permalink
Merge pull request #2244 from ballerina-platform/fix-rest-path-2201.5.x
Browse files Browse the repository at this point in the history
[2201.5.x] Fix rest path parameter generation with decoded value
  • Loading branch information
TharmiganK authored Dec 6, 2024
2 parents be15fcb + 1773840 commit aba40c4
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 52 deletions.
6 changes: 3 additions & 3 deletions ballerina-tests/http-advanced-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_advanced_tests"
version = "2.7.8"
version = "2.7.9"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.7.8"
version = "2.7.9"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.7.8.jar"
path = "../../test-utils/build/libs/http-test-utils-2.7.9-SNAPSHOT.jar"
6 changes: 3 additions & 3 deletions ballerina-tests/http-advanced-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -105,7 +105,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_advanced_tests"
version = "2.7.8"
version = "2.7.9"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "file"},
Expand All @@ -125,7 +125,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down
6 changes: 3 additions & 3 deletions ballerina-tests/http-client-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_client_tests"
version = "2.7.8"
version = "2.7.9"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.7.8"
version = "2.7.9"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.7.8.jar"
path = "../../test-utils/build/libs/http-test-utils-2.7.9-SNAPSHOT.jar"
6 changes: 3 additions & 3 deletions ballerina-tests/http-client-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -102,7 +102,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_client_tests"
version = "2.7.8"
version = "2.7.9"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "http"},
Expand All @@ -121,7 +121,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down
6 changes: 3 additions & 3 deletions ballerina-tests/http-dispatching-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_dispatching_tests"
version = "2.7.8"
version = "2.7.9"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.7.8"
version = "2.7.9"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.7.8.jar"
path = "../../test-utils/build/libs/http-test-utils-2.7.9-SNAPSHOT.jar"
6 changes: 3 additions & 3 deletions ballerina-tests/http-dispatching-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -99,7 +99,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_dispatching_tests"
version = "2.7.8"
version = "2.7.9"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "http_test_common"},
Expand All @@ -120,7 +120,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ service /encodedUri on utmTestEP {
}

service /restParam on utmTestEP {

resource function 'default 'string/[string... aaa]() returns json {
return {aaa: aaa};
}

resource function 'default 'int/[int... aaa](http:Caller caller) returns error? {
http:Response res = new;
json responseJson = {aaa: aaa};
Expand Down Expand Up @@ -1025,6 +1030,16 @@ function testEncodedPathParams() {
}
}

@test:Config {}
function testRestParamWithEncodedPathSegments() {
http:Response|error response = utmClient->get("/restParam/string/path%2Fseg/path%20seg/path%2Fseg+123");
if response is http:Response {
common:assertJsonValue(response.getJsonPayload(), "aaa", ["path/seg", "path seg", "path/seg+123"]);
} else {
test:assertFail(msg = "Found unexpected output type: " + response.message());
}
}

@test:Config {}
function testMultipleIntTypedRestParams() {
http:Response|error response = utmClient->get("/restParam/int/345/234/123");
Expand Down
6 changes: 3 additions & 3 deletions ballerina-tests/http-interceptor-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_interceptor_tests"
version = "2.7.8"
version = "2.7.9"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.7.8"
version = "2.7.9"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.7.8.jar"
path = "../../test-utils/build/libs/http-test-utils-2.7.9-SNAPSHOT.jar"
6 changes: 3 additions & 3 deletions ballerina-tests/http-interceptor-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -99,7 +99,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_interceptor_tests"
version = "2.7.8"
version = "2.7.9"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "http_test_common"},
Expand All @@ -115,7 +115,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down
6 changes: 3 additions & 3 deletions ballerina-tests/http-misc-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_misc_tests"
version = "2.7.8"
version = "2.7.9"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.7.8"
version = "2.7.9"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.7.8.jar"
path = "../../test-utils/build/libs/http-test-utils-2.7.9-SNAPSHOT.jar"
6 changes: 3 additions & 3 deletions ballerina-tests/http-misc-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -99,7 +99,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_misc_tests"
version = "2.7.8"
version = "2.7.9"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "http_test_common"},
Expand All @@ -118,7 +118,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down
6 changes: 3 additions & 3 deletions ballerina-tests/http-resiliency-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_resiliency_tests"
version = "2.7.8"
version = "2.7.9"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.7.8"
version = "2.7.9"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.7.8.jar"
path = "../../test-utils/build/libs/http-test-utils-2.7.9-SNAPSHOT.jar"
6 changes: 3 additions & 3 deletions ballerina-tests/http-resiliency-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -99,7 +99,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_resiliency_tests"
version = "2.7.8"
version = "2.7.9"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "http_test_common"},
Expand All @@ -116,7 +116,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down
6 changes: 3 additions & 3 deletions ballerina-tests/http-service-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http_service_tests"
version = "2.7.8"
version = "2.7.9"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.7.8"
version = "2.7.9"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.7.8.jar"
path = "../../test-utils/build/libs/http-test-utils-2.7.9-SNAPSHOT.jar"
6 changes: 3 additions & 3 deletions ballerina-tests/http-service-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -102,7 +102,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_service_tests"
version = "2.7.8"
version = "2.7.9"
dependencies = [
{org = "ballerina", name = "file"},
{org = "ballerina", name = "http"},
Expand All @@ -121,7 +121,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down
6 changes: 3 additions & 3 deletions ballerina-tests/http2-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerina"
name = "http2_tests"
version = "2.7.8"
version = "2.7.9"

[[dependency]]
org = "ballerina"
name = "http_test_common"
repository = "local"
version = "2.7.8"
version = "2.7.9"

[[platform.java11.dependency]]
scope = "testOnly"
path = "../../test-utils/build/libs/http-test-utils-2.7.8.jar"
path = "../../test-utils/build/libs/http-test-utils-2.7.9-SNAPSHOT.jar"
6 changes: 3 additions & 3 deletions ballerina-tests/http2-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -102,7 +102,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http2_tests"
version = "2.7.8"
version = "2.7.9"
dependencies = [
{org = "ballerina", name = "file"},
{org = "ballerina", name = "http"},
Expand All @@ -121,7 +121,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http_test_common"
version = "2.7.8"
version = "2.7.9"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "lang.string"},
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Fixed
- [Fix the issue of not being able to configure only server name in the secureSocket config](https://github.com/ballerina-platform/ballerina-library/issues/7443)
- [Fix rest path parameter generation with decoded path segments](https://github.com/ballerina-platform/ballerina-library/issues/7430)

## [2.7.8] - 2024-10-16

Expand Down
Loading

0 comments on commit aba40c4

Please sign in to comment.