1717// specific language governing permissions and limitations
1818// under the License.
1919
20+ import ballerina /data .jsondata ;
2021import ballerina /http ;
2122
2223public isolated client class Client {
@@ -52,7 +53,7 @@ public isolated client class Client {
5253 resourcePath = resourcePath + check getPathForQueryParam (queries );
5354 map < string | string []> httpHeaders = http : getHeaderMap (headerValues );
5455 http : Request request = new ;
55- json jsonBody = payload . toJson ();
56+ json jsonBody = jsondata : toJson (payload );
5657 request .setPayload (jsonBody , " application/json" );
5758 return self .clientEp -> post (resourcePath , request , httpHeaders );
5859 }
@@ -102,7 +103,7 @@ public isolated client class Client {
102103 resourcePath = resourcePath + check getPathForQueryParam (queries );
103104 map < string | string []> httpHeaders = http : getHeaderMap (headerValues );
104105 http : Request request = new ;
105- json jsonBody = payload . toJson ();
106+ json jsonBody = jsondata : toJson (payload );
106107 request .setPayload (jsonBody , " application/json" );
107108 return self .clientEp -> patch (resourcePath , request , httpHeaders );
108109 }
@@ -119,7 +120,7 @@ public isolated client class Client {
119120 }
120121 map < string | string []> httpHeaders = http : getHeaderMap (headerValues );
121122 http : Request request = new ;
122- json jsonBody = payload . toJson ();
123+ json jsonBody = jsondata : toJson (payload );
123124 request .setPayload (jsonBody , " application/json" );
124125 return self .clientEp -> post (resourcePath , request , httpHeaders );
125126 }
@@ -136,7 +137,7 @@ public isolated client class Client {
136137 }
137138 map < string | string []> httpHeaders = http : getHeaderMap (headerValues );
138139 http : Request request = new ;
139- json jsonBody = payload . toJson ();
140+ json jsonBody = jsondata : toJson (payload );
140141 request .setPayload (jsonBody , " application/json" );
141142 return self .clientEp -> post (resourcePath , request , httpHeaders );
142143 }
@@ -153,7 +154,7 @@ public isolated client class Client {
153154 }
154155 map < string | string []> httpHeaders = http : getHeaderMap (headerValues );
155156 http : Request request = new ;
156- json jsonBody = payload . toJson ();
157+ json jsonBody = jsondata : toJson (payload );
157158 request .setPayload (jsonBody , " application/json" );
158159 return self .clientEp -> post (resourcePath , request , httpHeaders );
159160 }
@@ -187,7 +188,7 @@ public isolated client class Client {
187188 }
188189 map < string | string []> httpHeaders = http : getHeaderMap (headerValues );
189190 http : Request request = new ;
190- json jsonBody = payload . toJson ();
191+ json jsonBody = jsondata : toJson (payload );
191192 request .setPayload (jsonBody , " application/json" );
192193 return self .clientEp -> post (resourcePath , request , httpHeaders );
193194 }
@@ -204,7 +205,7 @@ public isolated client class Client {
204205 }
205206 map < string | string []> httpHeaders = http : getHeaderMap (headerValues );
206207 http : Request request = new ;
207- json jsonBody = payload . toJson ();
208+ json jsonBody = jsondata : toJson (payload );
208209 request .setPayload (jsonBody , " application/json" );
209210 return self .clientEp -> post (resourcePath , request , httpHeaders );
210211 }
@@ -219,7 +220,7 @@ public isolated client class Client {
219220 }
220221 map < string | string []> httpHeaders = http : getHeaderMap (headerValues );
221222 http : Request request = new ;
222- json jsonBody = payload . toJson ();
223+ json jsonBody = jsondata : toJson (payload );
223224 request .setPayload (jsonBody , " application/json" );
224225 return self .clientEp -> post (resourcePath , request , httpHeaders );
225226 }
0 commit comments