You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a string array that I need to send inside a json payload of an http request. I have declared this array a const. When I add it to the json payload and send the request, the value is not being sent in the request.
Constant arrays are represented as tuple type in Ballerina. We are using JsonUtils.Serialize lang API to convert the json to a output stream which writes on the wire. Seems like the issue is with this lang API which does not consider the tuple case:
The JSONGenerator class has an older implementation where it assumes the object to be of explicit json type where all the elements are either from JSON primitives, json[], or map<json> types. Therefore it misses the alternative representations such as records and tuples.
Another workaround from the native side would be to use JsonUtils.convertToJson(value) before serializing the value.
We will provide a fix.
Description
I have a string array that I need to send inside a json payload of an http request. I have declared this array a
const
. When I add it to the json payload and send the request, the value is not being sent in the request.Steps to Reproduce
Declare a const string array:
Add this value in an http request payload:
Trace logs show the following as the req payload:
Version
2201.10.0
Environment Details (with versions)
OS: MacOS Sonoma
The text was updated successfully, but these errors were encountered: