I'm doing a REST service. A method has as body parameter a JSON corresponding to a class A.
In my production I have class A so that I retrieve the parameters using a dynamic object, such that:
Set body = ##class(%DynamicObject).%FromJSON(%request.Content)
Set myObjectA = ##class(A).%New()
Set myObjectA.Id = body.Id
Set myObjectA.Name = body.Name
Set myObjectA.Date = body.Date
Set myObjectA.Salary = body.Salary
I would like to know if I can avoid doing the manual mapping, doing a casting, since I am sure that FromJSON will return a class A. Something like this:
I created the Process to extract the required data from ADT message to a Dynamic Object. I wanted to send the JSON stream to EnsLib.File.PassthroughOperation operation and generate a file with the content of JSON stream.
I build an API and there I use $order to get the Data from my Globals. When I first time use that API it's get an error (504 Gateway-Timout > 60 Sec.).
After 2 reloads it works with a loading time of 2 Sec.! Sounds for me like the $order is cached and it works faster. Is it true $order will be cached?
When it works, I only get the error at the next day. So it's very hard to reproduce that error. Is it possible to delete the cache for $order?
i want to create an iris document database with Atelier with some properties, where i can import my JSON formatted data from an API to the database which i created. Right now i know how to import my local JSON formatted data to my created database:
I've extended the a class %JSON.Adaptor in my class definition and it contains the xData block MimeType of application/json. I got the error while compiling. Why this error occurs and how to resolve it
I am taking some intro lessons in REST from the online courses. Below is a very simple code i wrote. But when i try to see the output by entering the url
Doing a new project with %JSON.Adaptor, unexpectedly realized that %JSON.Adaptor does not support export to native JSON. %JSONExport just outputs directly to the current device, and there are two more methods %JSONExportToString, and %JSONExportToStream.
In conjunction with generating REST from swagger specification, where any generated method accepts as a result %DynamicObject, which is good.
I have multiple places in my REST where I have to return JSON for an object, but I have to modify the result a bit, just extend it with some other way.
I am trying to find out if it is possible to decode the Azure access token in IRIS. Has anyone ever tried this before? I need to decode the token to extract the "Scope" details in order to verify the scope to make sure client is permitted to do the request they have done.
If you could point me to any information, that'd be great.
Class TestDynamic Extends (%RegisteredObject, %XML.Adaptor)
{
Property number As %xsd.string;
Property exam As %xsd.string;
Property result As list Of %DynamicObject;
}
I'm adding objects to list normally
set objTest=##class(TestDynamic).%New()
set objDynamic={"field":"value"}
do objTest.result.Insert(objDynamic)
I want to parse large JSON object and store data into persistent tables. Is there any other way besides pre-defining persistent classes including typing each property name? Maybe parse it and store properties into a global so that I know what properties need to be defined for each class...