Alternative for %ZEN.Auxiliary.altJSONProvider).%ConvertJSONToObject
Hello,
I want to convert a json, which passed on in the a REST call, into a request message.
I use method %ConvertJSONToObject of the %ZEN.Auxiliary.altJSONProvider class.
Set sc = ##class(%ZEN.Auxiliary.altJSONProvider).%ConvertJSONToObject(%request.Content, "TestRequest", .request)
Is there an alternative for this? I want to avoid to use the %ZEN library.
Best Regards
Roger de Coninck
If you work on versions 2016.1 and later you can use native JSON.
I want to de-serialize an json string, received via REST, into a Ens.Request.
Best Regards
Roger.
Pls. provide your version
2017.2
I known how to create a dynamic object from a json string.
What do you mean with "create Ens.Request from that" ?
First create the request and assign the property one by one?
Or do you mean something else?
Best Regards
Roger.
Yes.
You need first to convert JSON into dynamic object and then create Ens.Request from that. Well, probably a subclass of Ens.Request as it can't hold any data.
Hello, you can use the class, for serialize and deserialize JSON.
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
%DynamicObject.
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue