Question Antoine.Dh · Jan 25, 2024

When exporting a %JSON.Adaptor inherited class, undefined %Boolean properties are exported to JSON as "false" instead of null or empty

is there any way to control this behavior?

Class Test.Json extends %JSON.Adaptor
{
    Property bool as %Boolean;
}
set test = ##class(Test.Json).%New()
do test.%JSONExport()
{
    "bool": false
}
2
0 176
Question Antoine.Dh · Jan 18, 2024

Hello, I tried to read a XML list from a web service into a response class by creating a custom collection subclass as described in this documentation page

Here's the XML file I am trying to read:

<Suppliers>
    <Supplier>
        <row>1</row>
    </Supplier>
    <Supplier>
        <row>2</row>
    </Supplier>
</Suppliers>

And the different classes I defined to project the XML into:

Class App.Messages.GetSuppliersResponse Extends (%Persistent, Ens.Response)
{
Property Suppliers As App.Objects.Suppliers;

Method Deserialize(stream as %Stream.
3
0 348