Author Message
russellsinger
Joined: Oct 13, 2016
Messages: 2
Offline
Hi all,
I'm having issues with interpreting JSON from the “Call REST service” task on ED 3.4.
According to external web server logs, the web service is returning the following JSON data:


{
"result": [
{
"active": "true"
}
]
}


However, in the ED workflow, this is all I see from the debug output:


{'responsePayloadType':'application/json;charset=UTF-8','responsePayload':{'result':[]},'oauthToken':'','responseCode':200}


My suspicion is that because the output contains a JSON array, the task is having difficulty mapping the data.
Which led me to try and build an ED variable I could map the data to.
But when I try to build a new variable with a valid JSON schema to parse the response data, I get an error saying “Data type is not defined for array items”.

That’s using the below schema for the variable:

{
"title":"responseJSON",
"type": "object",
"properties": {
"result": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"active": {
"type": "string"
}
}
}
]
}
}
}


That’s valid json for most of the validators I’ve tested it against. So no idea what is going on.
Just wondering if anyone has faced similar issues and was able to overcome them without writing a custom dynamic task?

Thanks!
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 154
Offline
can you please provide the workflow exported
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 154
Offline
as far as schema is concerned, please use

{

"title":"responseJSON",
"type": "object",
"properties": {
"result": {
"type": "array",
"items":
{
"type": "object",
"properties": {
"active": {
"type": "string"
}
}
}
}
}
}


please note that a pair of [] has been removed, we use this format in designer
Go to:   
Mobile view