json - 需要帮助修复 homebridge 插件的 JSON
问题描述
需要帮助修复 homebridge 插件的 JSON 语法。我一直在使用 jsonlint,但无法弄清楚如何修复下面的代码,因此语法是正确的。
{
"bridge": {
"name": "Homebridge",
"username": "xxx",
"port": 51826,
"pin": "xxx"
},
"accessories": [],
"platforms": [{
"name": "Config",
"port": 8080,
"auth": "form",
"log": {
"method": "file",
"path": "/Users/xx/.homebridge/homebridge.log" ["platform": "config"]
} {
"platform": "DysonPlatform",
"name": "DysonPlatform",
"email": "xxx",
"password": "xxx",
"country": "US"
"accessories": [{
"ip": "xxx",
"displayName": "Dyson",
"serialNumber": "xxx"
},
{
"ip": "ip of your second device",
"displayName": "Name to be shown on Home App",
"serialNumber": "DYSON-XXX-XX-XXXXXXXX-XXX",
"password": "password of your second device"
}
]
}
],
解决方案
格式化的 JSON
{
"bridge": {
"name": "Homebridge",
"username": "xxx",
"port": 51826,
"pin": "xxx"
},
"accessories": [],
"platforms": [{
"name": "Config",
"port": 8080,
"auth": "form",
"log": {
"method": "file",
"path": "/Users/xx/.homebridge/homebridge.log",
"platform": "config"
}
},
{
"platform": "DysonPlatform",
"name": "DysonPlatform",
"email": "xxx",
"password": "xxx",
"country": "US",
"accessories": [{
"ip": "xxx",
"displayName": "Dyson",
"serialNumber": "xxx"
}, {
"ip": "ip of your second device",
"displayName": "Name to be shown on Home App",
"serialNumber": "DYSON-XXX-XX-XXXXXXXX-XXX",
"password": "password of your second device"
}]
}
]
}
推荐阅读
- r - 如何使用 quanteda 查找句子中某些单词出现在某些其他单词之前的实例
- php - 在可以重新访问的 PHP 脚本中设置临时变量
- javascript - 将所有内部标签放入其容器中
- javascript - javascript从单独的字符串中替换循环中的文本
- html - 当我使用 Django Jinjna 模板将“schemaname.tablename”发送到 id 字段时,引导模式弹出中断
- javascript - 为什么履行的诺言没有定义?
- python - 在 DataFrame 中保留一些特定值并将其他值设置为零
- firebase - 更改包名称后应用程序在电话身份验证时崩溃 - Flutter
- python - 如何将逻辑约束转换为一组线性(整数)约束?
- python - 将 2D 数组转换为 3D 数组