ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
137 stars 58 forks source link

Rest types not properly work with Root element values in `data.xmldata` #6929

Open SasinduDilshara opened 1 month ago

SasinduDilshara commented 1 month ago

Code

import ballerina/data.xmldata;
import ballerina/io;
import ballerina/test;

string x1 = "<A>42</A>";

type A13 record {|int...;|};

public function main() {
    A13|error a13 = xmldata:parseString(x1);
    io:println(a13);
    test:assertEquals(a13, {"#content":42}); // assertion failed
}

This should not fails if the module works correctly.