Both possible structures are considered. Here, I use the examples from my previous posting:
set obj=##class(DC.Rick.MemberData).%OpenId(1)
do obj.%JSONExport() --> {"members":[{"dob":"1990-07-18","firstName":"Bob","memberId":123956}]}set obj=##class(DC.Rick.MemberData).%OpenId(2)
do obj.%JSONExport() --> {}The second example outputs {} only and not {"members":null}, I don't know why. Maybe there is a parameter which control this behavior, please ask WRC.
From the view of data value, you can consider {} and {"members":null} as equal.
write {"members":null}.%GetTypeOf("members") --> null
write {}.%GetTypeOf("members") ----------------> unassignedBoth representation mean, the members property has no value. But, yes, but you can philosophize about it ...
- Log in to post comments