In Ballerina I have a JSON object like this
json players = {
"123": {"x":500, "y":400},
"345": {"x": 300, "y":200}
}
I would like get an string from this object like:
string text = check <string>players;
This gives a runtime error:
'json' cannot be cast to 'string'
I am trying to get string representation of the JSON object and that is the reason I tried to cast it as above. What is the most suitable method to get a string representation of a JSON object in Ballerina?