ballerina-platform / ballerina-library

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

ClassCastException in xmldata:toXml when converting custom record type #6744

Closed ghoulbel closed 2 months ago

ghoulbel commented 2 months ago

Description:

I'm encountering a ClassCastException when using xmldata:toXml to convert a custom record type to XML.

Steps to reproduce:

import ballerina/data.xmldata; import ballerina/io;   public type VersionType string;   public type PayloadAnyType record {     @xmldata:Attribute     VersionType 'version?;     string 'type?; };   public function main() returns error? {     PayloadAnyType payload = {'version: "1.0", 'type: "example"};     xml result = check xmldata:toXml(payload);     io:println(result); }

Affected Versions: Data.xmldata version: 0.1.3 Ballerin 2201.9.1

github-actions[bot] commented 2 months ago

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.