Stumbled upon a different InterSystems github project that in my testing and with a little configuration works as I expected (https://github.com/stefanc82/Cache-DynamicObject-Adapter). Any thoughts on which project might be the preferred path for future?

I didn't come across this project when I searched github for projects that mention %DynamicObject/%DynamicArray. I'll look into this project as well.

Since it needs to be completely converted to JSON, my thinking is that each object needs to extend %Library.DynamicAbstractObject. I'm not sure if it is my structure or how I'm trying to access elements. I have a mix of single properties and collections of objects, so this is a great example to have on the community forum for a real world use case. The documentation has examples, but none that I saw that matched the complexity of what I've defined.

Can you put together some code to create the Test.Request object and set/get some of the properties, so we can see how it is supposed to be done?

Class Test.Request Extends %Library.DynamicAbstractObject
{
Property tag As %String;

Property body As Test.Body;

}

Class Test.Body Extends %Library.DynamicAbstractObject
{
Property requestType As List Of %String;

Property patient As Test.Patient;

}

Class Test.Patient Extends %Library.DynamicAbstractObject
{
Property sites As List Of Test.Site;

Property names As List Of Test.Name;

Property addresses As List Of Test.Address;

Property emails As %String;
}

Class Test.Address Extends %Library.DynamicAbstractObject
{
Property street As %String;

Property unit As %String;

Property city As %String;

Property state As %String;

Property zipCode As %String;
}

Class Test.Name Extends %Library.DynamicAbstractObject
{
Property first As %String;

Property middle As %String;

Property last As %String;

Property suffix As %String;
}

Class Test.Site Extends %Library.DynamicAbstractObject
{
Property code As %String;

Property mrn As %String;    
}