英文:
Expecting 'STRING', got 'EOF'
问题
我正在尝试为Ubiquiti防火墙创建一个config.gateway.json文件,并且我需要将文件上传到设备上。我访问网站jsonlint.com,并尝试将以下内容粘贴到其中运行:
{
"LOAD_BALANCE": {
"description": "LOAD_BALANCE",
"rule": {
"2000": {
"action": "modify",
"modify": {
"lb-group": "wan2_failover"
},
"source": {
"address": "172.16.7.0/24"
},
"interfaces": {
"bridge": {
"br0": {
"aging": "300",
"bridged-conntrack": "disable",
"hello-time": "2",
"max-age": "20",
"priority": "32768",
"promiscuous": "disable",
"stp": "false"
}
},
"load-balance": {
"group": {
"wan2_failover": {
"flush-on-active": "disable",
"interface": {
"br0": {
"failover-only": ""
},
"eth0": ""
},
"lb-local": "enable",
"lb-local-metric-change": "enable"
}
},
但是我遇到了错误 Expecting 'STRING', got 'EOF'
。
如果有Java方面的专家可以帮助我,我将不胜感激!
英文:
I'm trying to create a config.gateway.json file for a Ubiquiti firewall and I need to upload the file to it. I go to the website jsonlint.com and try to run the following into it:
{
"LOAD_BALANCE": {
"description": "LOAD_BALANCE",
"rule": {
"2000": {
"action": "modify",
"modify": {
"lb-group": "wan2_failover"
},
"source": {
"address": "172.16.7.0/24"
},
"interfaces": {
"bridge": {
"br0": {
"aging": "300",
"bridged-conntrack": "disable",
"hello-time": "2",
"max-age": "20",
"priority": "32768",
"promiscuous": "disable",
"stp": "false"
}
},
"load-balance": {
"group": {
"wan2_failover": {
"flush-on-active": "disable",
"interface": {
"br0": {
"failover-only": "''"
},
"eth0": "''"
},
"lb-local": "enable",
"lb-local-metric-change": "enable"
},
but I get the error Expecting 'STRING', got 'EOF'
If one of the fine Java gurus could help me I'd appreciate it!
答案1
得分: 0
看起来你的 JSON 中有一些未配对的花括号。也许这是你想要的内容:
{
"LOAD_BALANCE": {
"description": "LOAD_BALANCE",
"rule": {
"2000": {
"action": "modify",
"modify": {
"lb-group": "wan2_failover"
},
"source": {
"address": "172.16.7.0/24"
},
"interfaces": {
"bridge": {
"br0": {
"aging": "300",
"bridged-conntrack": "disable",
"hello-time": "2",
"max-age": "20",
"priority": "32768",
"promiscuous": "disable",
"stp": "false"
}
},
"load-balance": {
"group": {
"wan2_failover": {
"flush-on-active": "disable",
"interface": {
"br0": {
"failover-only": "''"
},
"eth0": "''"
},
"lb-local": "enable",
"lb-local-metric-change": "enable"
}
}
}
}
}
}
}
}
英文:
It looks like your JSON has some unbalanced curly brackets. Maybe this is what you're after:
{
"LOAD_BALANCE": {
"description": "LOAD_BALANCE",
"rule": {
"2000": {
"action": "modify",
"modify": {
"lb-group": "wan2_failover"
},
"source": {
"address": "172.16.7.0/24"
},
"interfaces": {
"bridge": {
"br0": {
"aging": "300",
"bridged-conntrack": "disable",
"hello-time": "2",
"max-age": "20",
"priority": "32768",
"promiscuous": "disable",
"stp": "false"
}
},
"load-balance": {
"group": {
"wan2_failover": {
"flush-on-active": "disable",
"interface": {
"br0": {
"failover-only": "''"
},
"eth0": "''"
},
"lb-local": "enable",
"lb-local-metric-change": "enable"
}
}
}
}
}
}
}
}
</details>
专注分享java语言的经验与见解,让所有开发者获益!
评论