我有一个大型JSON文件的数组对象 - 7510行。
我正在尝试使用json lint pro找出文件无效的位置。我一直在下面的图片中得到错误,但我找不到问题所在:
这是我文件末尾的最后3个对象,在第7509行结束 - 这是json lint看来引用的。我在这里看不到任何明显的东西,但我已经看了很长时间了!:
[...
{
"id": "111707",
"name": "Seven Park Place by William Drabble",
"phone": "+442073161600",
"email": "restaurant@stjameshotelandclub.com",
"website": "http://www.stjameshotelandclub.com/michelin-star-chef-william-drabble",
"location": {
"latitude": 51.5062548,
"longitude": -0.1403209,
"address": {
"line1": "7-8 Park Place",
"line2": "St James's",
"line3": "",
"postcode": "SW1A 1LP",
"city": "London",
"country": "UK"
}
}
},
{
"id": "104493",
"name": "Seymour's Restaurant & Bar",
"phone": "+442079352010",
"email": "reservations@theleonard.com",
"website": "http://www.theleonard.com",
"location": {
"latitude": 51.51463,
"longitude": -0.15779,
"address": {
"line1": "15 Seymour Street",
"line2": "",
"line3": "",
"postcode": "W1H 7JW",
"city": "London",
"country": "UK"
}
}
},
{
"id": "250922",
"name": "Shaka Zulu",
"phone": "+442033769911",
"email": "info@shaka-zulu.com",
"website": "http://www.shaka-zulu.com/",
"location": {
"latitude": 51.5414979,
"longitude": -0.1458655,
"address": {
"line1": "Stables Market ",
"line2": "Camden",
"line3": "",
"postcode": "NW1 8AB",
"city": "London",
"country": "UK"
}
}
}
]
当我在终端中运行文件时(只是为了得到多少个对象的长度),我得到了这个“意外令牌”错误:
.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/json-1.8.3/lib/json/common.rb:155:in `parse': 399: unexpected token at '' (JSON::ParserError)
from /Users/dan14/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/json-1.8.3/lib/json/common.rb:155:in `parse'
from length.rb:3:in `<main>'