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
Description:
The below sample returns an error while parsing using jsondata:parserAsType(), this error occurred when given data type has data type with readonly ,
import ballerina/io;
import ballerina/data.jsondata;
public type User readonly & record {|
int id;
|};
public function main() returns jsondata:Error? {
json user2 = {id: 4012};
User r2 = check jsondata:parseAsType(user2);
io:println(r2);
}
error: {ballerina}TypeCastError {"message":"incompatible types: 'error' cannot be cast to '(anydata|data.jsondata:Error)'"}
at ballerina.data.jsondata.0:parseAsType(json_api.bal:24)
Description:
The below sample returns an error while parsing using jsondata:parserAsType(), this error occurred when given data type has data type with readonly ,
Steps to reproduce:
Run the above given sample
Affected Versions:
2201.10.1
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):
The text was updated successfully, but these errors were encountered: