1 (edited by dan.jones 22-05-2014 16:26:07)

Topic: JSON parse failure from dataset service

Hello folks.

I've been running into some errors with the dataset responses so I stuck the JSON into lint

https://data.nbn.org.uk/api/datasets/GA000312

http://jsonlint.com/

.. and it fails because of unescaped quotes in the response text.

Any ideas?

Thanks. Dan

2

Re: JSON parse failure from dataset service

Oh hang on - It's me again. I've got a caching proxy to the services and it looks like that must be stripping out the escapes somewhere between storing the response in the database and selecting it back out again.

Sorry for the false alarm again. Dan

3

Re: JSON parse failure from dataset service

For some reason the problem was caused by html element tags in the JSON text boxes like the dataset summary field. The response from the service parsed OK but having saved it to the database and retrieved it, the json parser failed at the first html paragraph tag. I've now stripped all the html tags out of the response and it works fine but I'm not sure what I'm losing as a result.

4

Re: JSON parse failure from dataset service

Hi Dan, could you let us know what datasets you where having trouble with, I can have a quick look and see if there is something we can do at our end as well.

Thanks,
Matt

Matt Debont
Application Developer
Joint Nature Conservation Committee, Monkstone House, City Road, Peterborough PE1 1JY, UK