appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
950 stars 98 forks source link

Malformed JSON Returned from https://alpha-api.app.net/stream/0/users/me #107

Closed dquick-freelance closed 12 years ago

dquick-freelance commented 12 years ago

The endpoint in the title returns malformed JSON, which breaks parsing via jQuery in Firefox unless the return data type is explicit specified, and breaks parsing in Internet Explorer 7-9 regardless of the specified return data type.

To reproduce using curl:

curl -o get-me.txt "https://alpha-api.app.net/stream/0/users/me?access_token=[insert_valid_access_token_here_please]

Response (using one of my tokens):

{ "avatar_image": { "height": 142, "url": "https://d1f0fplrc06slp.cloudfront.net/assets/user/65/30/00/6530000000000000.jpg", "width": 142 }, "counts": { "followers": 380, "following": 127, "posts": 1548 }, "cover_image": { "height": 720, "url": "https://d1f0fplrc06slp.cloudfront.net/assets/user/55/30/00/5530000000000000.jpg", "width": 960 }, "created_at": "2012-08-06T23:34:30Z", "description": { "entities": { "hashtags": [ { "len": 9, "name": "quickApp", "pos": 131 } ], "links": [ { "len": 28, "pos": 144, "text": "http://www.quickapplabs.com/", "url": "http://www.quickapplabs.com/" }, { "len": 7, "pos": 190, "text": "App.net", "url": "http://App.net" } ], "mentions": [] }, "html": "<span itemscope=\"https://app.net/schemas/Post\">I'm Dave - I write software, songs, sonnets, and sometimes silliness. I try to focus on the silliness.\r\n\r\nSpending all my time on <span itemprop=\"hashtag\" data-hashtag-name=\"quickApp\">#quickApp at < a href=\"http://www.quickapplabs.com/\">http://www.quickapplabs.com/ - your real-time <a href=\"http://App.net\">App.net web client, updated (almost) daily with new stuff!", "text": "I'm Dave - I write software, songs, sonnets, and sometimes silliness. I try to focus on the silliness.\r\n\r\nSpending all my time on #quickApp at http://www.quickapplabs.com/ - your real-time App.net web client, updated (almost) daily with new stuff!" }, "id": "247", "locale": "en_US", "name": "Dave Quick", "timezone": "America/Los_Angeles", "type": "human", "username": "q"

Please note the lack of a closing curly brace. This causes IE to fail silently which has caused me no end of grief. This is also somewhat of a showstopper for widespread use of web-based App.net clients that choose to operate without a server-side parsing scheme.

berg commented 12 years ago

I've worked with @dquick-freelance and we can't seem to reproduce. I'll reopen if we can.