Valid JSON?

0
I'm, working on a REST service to consume a service. The eror I get in mendix runtime is an structure error. When i put the output in a online validator no errors. Weird. Any suggestions? java.lang.RuntimeException: java.lang.IllegalArgumentException: Response body does not seem to be a valid JSON Object. A JSON object starts with '{' but found: {"uitspraak":[{"modified":"2014-07-16T04:09:24"},{"identifier":"ECLI:NL:RVS:2014:1424"},{"issued":"2014-04-23"},{"publisher":"Raad voor de Rechtspraak"},{"creator":"Raad van State"},{"date":"2014-04-23"},{"spatial":"'s-Gravenhage"},{"subject":"Bestuursrecht"},{"linkidentifier":"http://deeplink.rechtspraak.nl/uitspraak?id=ECLI:NL:RVS:2014:1424"},{"title":"ECLI:NL:RVS:2014:1424 Raad van State , 23-04-2014 / 201304779/1/A2"},{"abstract":"Bij besluit van 2 juni 2004 heeft de minister van Verkeer en Waterstaat (hierna: minister) de per 1 januari 2004 nog niet betaalde voorschotten van de bij besluit van 23 december 2009 (hierna: verleningsbesluit) aan het Regionaal Orgaan Amsterdam (de rechtsvoorganger van SRA; hierna: ROA) verleende subsidie verhoogd met het voor dat jaar vastgestelde indexeringspercentage van 1,23%."}]} at restservices.consume.RestConsumer$7.apply(RestConsumer.java:475) at restservices.consume.RestConsumer$7.apply(RestConsumer.java:456) at restservices.consume.RestConsumer.doRequest(RestConsumer.java:267) at restservices.consume.RestConsumer.request(RestConsumer.java:456) at restservices.actions.request.executeAction(request.java:43)
asked
2 answers
0

For me the JSON you pasted does not validate either, for example on http://jsonlint.com/ or http://json.parser.online.fr/

answered
2

Your request seems to be valid, but just try copy pasting it into a regex tester such as: https://regex101.com/ When I copy your json and match it against the regex used: ^\s{[\s\S] it does not validate.

If you copy paste the response message, put the cursor at the start of the message and press the 'delete' key on your keyboard once, nothing seems to happen but suddenly the message does validate on regex101 and also the two json validators Bas mentioned now like the json string.

This leads me to believe that the application creating the message either works with a mismatching encoding or something between your mendix app and the other app adds additional bytes in front of the requests.

answered