Open DimuthuMadushan opened 5 months ago
We are not supporting nullable fields. We only support optional fields like below,
import ballerina/xmldata;
import ballerina/io;
type Response record {|
string status?;
int value?;
boolean isTrue?;
|};
public function main() returns error? {
Response response = {
status: "success",
value: 10,
isTrue: ()
};
xml x = check xmldata:toXml(response);
io:println(x);
}
This will remove the element completely when the value is nil or not set.
Referring to the SFO[1], we should support nillable fields by adding the attribute xsi:nil="true"
to the nil fields
Description: Consider the following code:
When there is a
()
value in the record, this returns a NPE.Bal version: 2201.8.6