我最近在格式错误的JSON上遇到了很多错误。像
这样的事情com.google.gson.stream.MalformedJsonException: Expected EOF at line 1 column 14
和
com.google.gson.stream.MalformedJsonException: Expected EOF at line 1 column 3
我想尝试更好地理解这些错误,它们不会在我的设备上发生,因此我无法重现它们,但我知道它们应该包含什么。问题是我不知道这些消息所指的JSON的哪一部分。 EOF意味着文件的结尾,所以我猜测某个地方有一个'}',但我不确定。
邮件的“列”部分特别令人困惑。据我所知,JSON没有任何列......
谢谢
修改
以下是可能收到的JSON示例。它是从网络服务器请求的,因此它有一些可变部分。
{
"mix_set": {
"mixes": [
{
"id": 2630390,
"path": "/mixes/2630390",
"web_path": "/meerareed/swamp-witch",
"name": "swamp witch",
"user_id": 2454178,
"published": true,
"cover_urls": {
"sq56": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max&w=56&h=56&fit=max",
"sq100": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max&w=100&h=100&fit=max",
"sq133": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max&w=133&h=133&fit=max",
"max133w": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max&w=133&fit=max",
"max200": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max&w=200&h=200&fit=max",
"sq250": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max&w=250&h=250&fit=max",
"sq500": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max&w=500&h=500&fit=max",
"max1024": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max&w=1024&h=1024&fit=max",
"original": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max&",
"original_url": "http://8tr.s3.amazonaws.com/i/000/811/509/Untitled-1-4428.jpg",
"original_imgix_url": "http://8tracks.imgix.net/i/000/811/509/Untitled-1-4428.jpg?fm=jpg&q=65",
"cropped_imgix_url": "http://8tracks.imgix.net/i/000/811/509/c/Untitled-1-9160.jpg?fm=jpg&q=65&fit=max"
},
"description": "a southern gothic fanmix.\ntracklisting: http://i.imgur.com/WcZNkMx.jpg",
"plays_count": 851,
"tag_list_cache": "southern gothic, southern gothic swamp folk, folk",
"first_published_at": "2013-10-16T23:32:15Z",
"likes_count": 204,
"certification": "gold"
}
],
"smart_id": "all",
"smart_type": "all",
"path": "/explore/all/hot",
"name": "Trending",
"web_path": "/explore/all"
},
"status": "200 OK",
"errors": null,
"notices": null,
"logged_in": true,
"api_version": 3
}