%RegisteredObject to JSON
How to export the %RegisteredObject to JSON in Cache 2016.2?
Discussion (2)0
Comments
The jsonProvider code may also be invoked from a non-Zen context by calling one of the following APIs:Example:proof
- %WriteJSONFromArray
- %WriteJSONFromObject
- %WriteJSONStreamFromArray
- %WriteJSONStreamFromObject
- %ConvertJSONToObject
d ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(.stream,..%OpenId(1),,,1,"aelqoc") w "<- json = ",stream.Read(),!
16.2 has %ZEN.Auxiliary.altJSONProvider, which has same method signatures but may be preferable (faster).