Jump to content
ertank

Returning mater-detail json

Recommended Posts

Hello,

 

I have orders and orderdetails tables. There is one method that should be returning several orders when used. I would like to return a json string to such requests as in following example

{
   "orders":[
      {
         "id":1234,
         "date":"2020-05-29",
         "details":[
            {
               "item":"1",
               "amount":3
            },
            {
               "item":"5",
               "amount":2
            },
            {
               "item":"116",
               "amount":1.3
            }
         ]
      }
   ]
}

 

I know that I can define method to return a TJsonObject and build json piece by piece in method code. However, I would like to avoid that, if possible. I wonder if there is/are some other ways of doing so in MARS.

 

Thanks & regards,

Ertan

Edited by ertank

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×