Excel 2016 - JSON 网络查询 - JSON 输入末尾的额外字符

Excel 2016 - JSON web query - extra characters at the end of JSON input

我正在尝试通过我的网络服务器 return 一些数据到 Excel。

Function ReturnSomeJson(id As String) As JsonResult
    Return Json(DataProvider.GetSomeData(id), JsonRequestBehavior.AllowGet)
End Function

如果我现在去 New Query -> From File -> From JSON 输入 url http://localhost:666/ReturnSomeJson/666,它会尝试打开它,但我收到以下错误消息:

Details: "We found extra characters at the end of JSON input."

JSON 没有任何问题,以前有人遇到过这个问题或有想法以其他方式轻松解决这个问题吗?

来自以上评论:

好的,最后一个想法 - 属性 名称是否使用小写字母 - 之前让我感到困惑,需要使用 CamelCasePropertyNamesContractResolver

例如如果你看这个 URL http://api.scb.se/OV0104/v1/doris/en/ssd - 应该格式化为 {"id":"BE","type":"l","text":"Population"} 而不是 {"Id":"BE","Type":"l","Text":"Population"}

这个威胁可能由来已久,但我试图通过 Power Query 将 AWS CloudCheckr JSON 摄取到 Excel 中并得到“我们在 [=26= 的末尾发现了额外的字符” ] 输入。

https://jsonformatter.org/ 的帮助下,终于弄清楚了一些数据是作为 True 提供的——没有引号,Excel PQ 需要这些数据。简单的 find/replacing :True,:"True", 就成功了。

说真的,微软,你发现布尔值的时候没认出来? Excel 本来就没有问题。