import ballerina/io;
import ballerina/data.jsondata;
type DDPerson record {|
readonly int id;
|};
public function main() returns error? {
string user2 = string `{"id": 4012}`;
DDPerson r2 = check jsondata:parseString(user2);
io:println(r2.id);
}
The above code give following error
error: {ballerina}TypeCastError {"message":"incompatible types: 'error' cannot be cast to '(anydata|data.jsondata:Error)'"}
at ballerina.data.jsondata.0:parseString(json_api.bal:33)
test:main(test.bal:10)
Steps to Reproduce
This is similar to the #7259 but occurs in parseString API
Description
The above code give following error
Steps to Reproduce
This is similar to the #7259 but occurs in
parseString
APIVersion
2201.10.2
Environment Details (with versions)
No response