Forums/Layer Development Platform/Report a bug - Publishing Site v6.2

Answered

error messages when testing layer are completely misleading

matteosistisette
asked this on September 27, 2011 17:11

When you test your layer at the "Test your layer" page and something is wrong in the response from the server, the error message most of the time either doesn't make sense, or it makes perfect sense and is plainly wrong.

Just an example: I'm trying to build an API5-compliant layer, and I get this message:

  • response code : 200
    error validating provider response - Traceback (most recent call last): File "/var/www/layar.com/app/api/handlers/api_layer/mainproxy.py", line 85, in validate_response data = validator.validate(response_as_dict, schema) File "/var/www/layar.com/app/api/jsontransmogrifier.py", line 560, in validate raise ValidationError(message=", ".join(self.errors), errors=self.errors) ValidationError: Missing value ''contentType'' in response: , Failed to validate field 'hotspots' list schema: "Missing value ''contentType'' in response: "
    JSON parse error( most likely)!, validate your response at http://www.jsonlint.com/
    Missing value ''contentType'' in response: , Failed to validate field 'hotspots' list schema: "Missing value ''contentType'' in response: "
    Error: No content available

This seems to indicate that there is a missing "contentType" field, but according to API 5 documentation, the hotspot has no mandatory (nor even optional) contentType field. The contentType field exists in the hotspot object only in API6; in API 5 it exists in the action object, but in my case there is no action at all. I'm sure there's something wrong in my server response but this error message is inconsistent, so either it or the api documentation is wrong.

 

ANOTHER example is if you happen to pass the lat and long fields of the anchor as strings rather than as floats. It took me ages to figure out. You get a completely screwed up error message that tells something about an int and shows values that are not even in the response. 

 

Comments latest first

User photo
Oleksandr Lezvinskyi

Hello

Could you please write your layer name?

Best Regards 

Alex

October 11, 2011 10:41
User photo
matteosistisette

yes, obviously, this was with the api version set to 5 in the filter settings.

October 06, 2011 09:19
User photo
Oleksandr Lezvinskyi

Hello

Did you try to change on testing page in the filter settings API version to 5?

Best Regards

Alex

October 06, 2011 08:40