diff --git a/ballerina-tests/http-dispatching-tests/tests/service_dispatching_query_param_binding_test.bal b/ballerina-tests/http-dispatching-tests/tests/service_dispatching_query_param_binding_test.bal index f3b97520d6..c442d6ec0d 100644 --- a/ballerina-tests/http-dispatching-tests/tests/service_dispatching_query_param_binding_test.bal +++ b/ballerina-tests/http-dispatching-tests/tests/service_dispatching_query_param_binding_test.bal @@ -343,11 +343,11 @@ function testMapJsonOfDefaultableQueryBinding() returns error? { function testMapJsonArrOfDefaultableQueryBinding() returns error? { json response = check queryBindingClient->get("/default/q4"); common:assertJsonPayloadtoJsonString(response, { - objects: [ - {name: "test1", value: "json1"}, - {name: "test2", value: "json2"} - ] - }); + objects: [ + {name: "test1", value: "json1"}, + {name: "test2", value: "json2"} + ] + }); } @test:Config {} diff --git a/native/src/main/java/io/ballerina/stdlib/http/api/service/signature/ParamHandler.java b/native/src/main/java/io/ballerina/stdlib/http/api/service/signature/ParamHandler.java index 514ee11c6d..213d80318d 100644 --- a/native/src/main/java/io/ballerina/stdlib/http/api/service/signature/ParamHandler.java +++ b/native/src/main/java/io/ballerina/stdlib/http/api/service/signature/ParamHandler.java @@ -291,7 +291,7 @@ private static String getQueryParamName(String paramName, BMap annotations) { BMap mapValue = annotations.getMapValue(StringUtils.fromString(QUERY_ANNOTATION)); Object queryName = mapValue.get(HttpConstants.ANN_FIELD_NAME); if (queryName instanceof BString query) { - paramName = query.getValue(); + return query.getValue(); } return paramName; }