![]() |
不要命的自行车 · 【第87场】知名高中基础医学专业宣讲——学军 ...· 3 月前 · |
![]() |
伤情的充电器 · 西南交通大学研究生招生网-招生简章· 9 月前 · |
![]() |
面冷心慈的大海 · 凸凹吧福利极品无圣光美女图 专题 - 男阿美图网· 10 月前 · |
![]() |
打酱油的莴苣 · html to pdf java ...· 1 年前 · |
In addition to my response,
The JSON is 100% valid, only native OutSystems can't handle this response, because of the dynamic json keys in alternative_countries,
8 years
I'm pretty sure that
Isn't valid JSON? For one, there's missing quotes.
{ US, GB, JP } is indeed not valid, But I can't find this in the provided JSON file, So my guess was this was type to explain the difference between a object and an array.
But the provided JSON files is 100% correct
8 years
Ah, right, missed the attachment. Thx.
Hi @Damian Fonville ,
Tried to remove the field and it worked! Thanks
Hello Dianara,
It seems response of API is not matching your output structure of this API.
Try to test API first on service studio and copy output to output body. Also you can check service center => monitoring => integration and find error of that API.
You may also need to increase logging level of that API to get request and response then compare it to your output structure by following steps into URL: https://success.outsystems.com/documentation/11/extensibility_and_integration/set_the_logging_level_of_rest_and_soap_integrations/
I have done this Test the API first then copy the output to the response body, but still, I am getting the error
I would recommend to set logging level of that API to full as mentioned into URL I share with you then call your API one more time then go to service center => monitoring => integration and find the error of API open details and download response Json and compare it to Json returned when you test API using service studio, you may find any difference that causing issue.
Hi @Dianara Bathan ,
Try to debug OnAfterEvent of API and check response there.
Best,
Arun
Hi Dianara Bathan ,
The JSON string which you are passing to deserializing is of list type but the structure which you have assigned to deserialize action is not list type. Kindly make it of list type and then try.
Hope this helps you.
Hi,
The issue is with the alternative_countries object, Because the keys are dynamic you can't parse this to a structure or you have to create every possible country in the structure enable to parse it.
If you don;t need this field you could remove it from the sample response to generate the api, this way OutSystems skipped this field in serilization
In addition to my response,
The JSON is 100% valid, only native OutSystems can't handle this response, because of the dynamic json keys in alternative_countries,
8 years
I'm pretty sure that
Isn't valid JSON? For one, there's missing quotes.
{ US, GB, JP } is indeed not valid, But I can't find this in the provided JSON file, So my guess was this was type to explain the difference between a object and an array.
But the provided JSON files is 100% correct
8 years
Ah, right, missed the attachment. Thx.
Hi @Damian Fonville ,
Tried to remove the field and it worked! Thanks
8 years
Hi Dianara,
"Is it possible that the cause of this is because the alternative_country structure has sometimes
"alternative_countries": { US,GB,JP} and on the other data it is like this "alternative_countries":[] ?"
"{US,GB,JP}" isn't valid JSON, so if that's what is returned, it rightly fails. For one, you cannot have a list of things in an object, and secondly, if it were an array, then you'd need quotes around the values, like this:
So perhaps you can check what's the actual JSON in both cases, so we can advise you what to do.
Note that the error you get does, in general, mean that an attribute is sent polymorphic, for example, it is normally sent as above (an array), but if there's no data it's sent like {}, for example.
8 years
Ok, I missed the attachment. There's two problems here. For one, these kinds of dynamic keys can't be handled by OutSystems:
OutSystems wants attributes to be fixed.
Secondly, there's a problem with "alternative_countries" being polymorphic: sometimes it's an object as above, sometimes an array:
There's a number of possibilities to fix this. You can either use the On After Response and fix the JSON into something that OutSystems understands, or you just get the JSON in its entirety and use ArdoJSON to parse it (especially JSON_Objectify for the dynamic attributes).
8 years
Since this comes up a lot on the forum, I created an Idea for it. Vote for it here .
8 years
As a reply to my Idea, Leonardo Fernandes replied with an example how to handle your case with his AdvancedREST Forge asset .