JSON Nested Objects

  

Hi,

I'm working with a web service which requires nested JSON objects sent in a request. However, I can't seem to figure out how to build a structure that will accommodate this requirement in OutSystems. It seems that OutSystems will only nest attributes, but not an object within an object.

See examples:

Under "do" I can add an array with an object containing "add" and "remove" 


But I can't seem to figure out how to nest the "add" and "remove" into their own objects, which is what the web service requires (can't seem to do this in OutSystems):


Any suggestions are appreciated!

Thanks,

Solution

Hi Ryan,

OutSystems does not handle recursive data types (structures whose attributes are themselves).

A work around is to consume the web service using an extension.

If you need the response of the web service mapped into an OutSystems structure then your structure can not have recursivity. You can do that if you know the maximum depth of your structure and then setting up different structures for the different levels of depth.

Cheers,

José

Solution

José Costa wrote:

Hi Ryan,

OutSystems does not handle recursive data types (structures whose attributes are themselves).

A work around is to consume the web service using an extension.

If you need the response of the web service mapped into an OutSystems structure then your structure can not have recursivity. You can do that if you know the maximum depth of your structure and then setting up different structures for the different levels of depth.

Cheers,

José

Thanks José,

I forgot to mention I'm POSTing to the web service. I ended up just creating a variable of type Text, populating it with the JSON (required by the web service) then POSTing it with the "Request" data type set to Text too.