ballerina-library
ballerina-library copied to clipboard
Invalid error message in Union types for `data.jsondata` module
code
import ballerina/data.jsondata;
import ballerina/io;
type A43 record {|record{|int[]|int \#content; string...;|} B;|}|record {|int[]|record{|string \#content; string...;|} B;|};
public function main() {
A43|error a = jsondata:parseAsType({B: [1,2,3]});
io:println(a);
}
Output
error Error ("incompatible expected type 'xml_data_prod:A43' for value '{"B":[1,2,3]}'")
But this should be mapped with record {|int[]|record{|string \#content; string...;|} B;|}