Im trying to parse the following JSON from a web service callout, however im getting the above error on this line:

while(parser.nextToken() != null)

Is it to do with the '\' in the json?? if so how do i deal with it? Appreciate any suggestions?

{   "place_id":"12037085",
"licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright",
"display_name":"Nany Lamb Indonesian, Woodmere Close, Clapham Junction, London Borough of Wandsworth, London, Greater London, England, SW11, United Kingdom, European Union",
    "restaurant":"Nany Lamb Indonesian",
    "road":"Woodmere Close",
    "suburb":"Clapham Junction",
    "city":"London Borough of Wandsworth",
    "state_district":"Greater London",
    "country":"United Kingdom",
    "continent":"European Union"

1 Answer 1


Your parsing this in Apex, correct?

I was able to feed your sample JSON into JSON2Apex and generate strongly typed Apex classes to parse it. The one issue here was the class member as it conflicted with a reserved Apex keyword. See How do you deserialize json properties that are reserved words in apex?

Debugging the license member gave:

Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright

And icon:


So it seemed to parse fine with the exception of the reserved keyword.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .