460
Views
5
Comments
Solved
Failed to parse response
Question

This is my first post here and I do have tiny bit of OutSystems experience.

I'm doing the "Build a Mobile App in 2 hours." and I get error while retrieving data from REST call at section "Creating a bootstrap to store the Planet’s Images".

and exception happens here while debugging ( learned to get debugging to get this out). See red arrow below image.


How I should proceed with troubleshooting on this?

2018-09-05 10-36-06
Sampsa Sohlman
Solution

Thank you for a quick response.

I think I found the reason. The JSON has a field "edited"

Example:

..
"thumbnail": "self",
"edited": 1535282226.0,
"author_flair_css_class": null,

..

But now the some of the field values were:

..

"edited": false

..

The "Data type" at structure was defined as "Decimal". So I changed it as "Text" and it seemed to work.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Sampsa,

The error means the REST service returns something that's not valid JSON. To troubleshoot, follow the steps I described here, and check what exactly the REST service is returning.

2018-09-05 10-36-06
Sampsa Sohlman
Solution

Thank you for a quick response.

I think I found the reason. The JSON has a field "edited"

Example:

..
"thumbnail": "self",
"edited": 1535282226.0,
"author_flair_css_class": null,

..

But now the some of the field values were:

..

"edited": false

..

The "Data type" at structure was defined as "Decimal". So I changed it as "Text" and it seemed to work.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Mmm, weird, the number looks like a valid Decimal... Anyway, great you found a workaround.

2018-09-05 10-36-06
Sampsa Sohlman

Kilian Hekhuis wrote:

Mmm, weird, the number looks like a valid Decimal... Anyway, great you found a workaround.

I did edit my own response. The edited value was "false". Not a Decimal. 

Anyway as OutSystem newbie and future professional I found already new feature that should be improved. Now I mean how OS JSON parsing is giving error message on this point.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

If it was "false", the field is likely a Boolean, and you could try to set it to that (instead of Text).

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.