-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: The fromBalString
function is not working properly for map expression
#41700
Comments
While the output is incorrect here, I think the result should be an error here. https://central.ballerina.io/ballerina/lang.value/latest#fromBalString
The string for which this would work would have quotes in the keys. import ballerina/io;
public function main() returns error? {
string mapExpString = string `{"name": "John", "city": "London"}`;
anydata output = check mapExpString.fromBalString();
io:println(output); // {"name":"John",""city":"London"}
io:println(output is map<anydata>); // true
} import ballerina/io;
public function main() returns error? {
map<string> mapValue = {name: "John", city: "London"};
string mapValueToBalString = mapValue.toBalString();
io:println(mapValueToBalString); // {"name":"John","city":"London"}
anydata mapValueFromBalString = check mapValueToBalString.fromBalString();
io:println(mapValueFromBalString is map<anydata>); // true
io:println(mapValueFromBalString); // {"name":"John","city":"London"}
} |
This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now. |
Description
$ Subject
Steps to Reproduce
Run the below code:
Affected Version(s)
Ballerina SwanLake 2201.7.x, 2201.8.x
OS, DB, other environment details and versions
No response
Related area
-> Runtime
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: