diff --git a/.github/workflows/regenerate-connector.yml b/.github/workflows/regenerate-connector.yml index 25549d4..9d949a6 100644 --- a/.github/workflows/regenerate-connector.yml +++ b/.github/workflows/regenerate-connector.yml @@ -60,7 +60,7 @@ jobs: additional-flatten-flags: ${{ inputs.additional-flatten-flags }} align-openapi: ${{ inputs.align-openapi }} additional-align-flags: ${{ inputs.additional-align-flags }} - additional-generation-flags: ${{ inputs.additional-generation-flags }} + additional-generation-flags: '--client-methods remote ${{ inputs.additional-generation-flags }}' distribution-zip: ${{ inputs.distribution-zip }} auto-merge: ${{ inputs.auto-merge }} ballerina-version: ${{ inputs.ballerina-version }} diff --git a/ballerina/client.bal b/ballerina/client.bal index bca4816..2b204d2 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -17,6 +17,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/data.jsondata; import ballerina/http; public isolated client class Client { @@ -69,7 +70,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->put(resourcePath, request, httpHeaders); } @@ -121,7 +122,7 @@ public isolated client class Client { resourcePath = resourcePath + check getPathForQueryParam(queries); map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->put(resourcePath, request, httpHeaders); } @@ -138,7 +139,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -155,7 +156,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->put(resourcePath, request, httpHeaders); } @@ -173,7 +174,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->put(resourcePath, request, httpHeaders); } @@ -241,7 +242,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -359,7 +360,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -392,7 +393,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -457,7 +458,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->put(resourcePath, request, httpHeaders); }