%JSON.Adaptor and relationship property
Hi.
Why are relationship properties not included in %JSONExportToString() method even they have cardinality one or parent?
Regards,
Matjaž
Comments
As far as I know, they should be included in the output. If you want to force it you can add a property parameter on the relationship. https://docs.intersystems.com/irisforhealth20221/csp/docbook/DocBook.UI…
// Relationship to be includeed in JSONExport using JSON adaptor
Relationship Ingredients as Food.Item(%JSONINCLUDE = "inout", %JSONREFERENCE = "object") [ Cardinality = one, Inverse = Recipe ];Hi.
I tried to include both of paramaters, but with no success. It looks like %JSON.Adaptor has some limitations...
Regards,
Matjaž
I did some research... Relationship properties with cardinality one or parent are not included by default in JSON serialization. If property is included with parameter %JSONINCLUDE is not enough, because serialization causes infinitive recursion. XData Mapping or %JSONINCLUDE="NONE" in related class should be used to avoid infinitive recursion.
Regards,
Matjaž