Question Javier Gonzalez · Jun 6, 2017 Generic Class in COS Hello everyone, I'm doing a REST service for integration between 2 systems. The system that invokes me expects a response object where only one of its attributes changes. It could be something like this: #ObjectScript #REST API #Caché 0 3 0 571
Question Javier Gonzalez · Jun 1, 2017 Casting JSON 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: #Ensemble #JSON #REST API #Mapping #Caché 0 9 1 924