问题描述
我在使用 Visual Studio Code 时遇到了一个奇怪的问题.我有以下 JSON 文件有问题:
I'm having a strange problem with Visual Studio Code.I have the following JSON file that has a problem:
{
"attribute": "// numeroConta",
"operator": "=",
"value": 0030152201
}
问题被指责为价值";在第二个数字零.问题如下:预期的commajson (514)我在搜索中一无所获.有什么想法吗?
The problem is accused of "value" in the second number zero. The problem is as follows:Expected commajson (514)I found nothing in my searches. Any idea?
推荐答案
如果你想在数字上有前导 0,你需要把它变成一个字符串并用 "
If you want to have leading 0's on the number, you will need to make is a string and enclose it in "
{
"attribute": "// numeroConta",
"operator": "=",
"value": "0030152201"
}
否则去掉前导0,没有直接跟小数点的前导0(即0.2也可以)在JSON格式中看不到数字,见StackOverflow 问题在这里.
Otherwise remove the leading 0's, leading 0's that are not directly followed by a decimal point (i.e. 0.2 is fine) are not seen as numbers in the JSON format, see the StackOverflow issue here.
这篇关于Visual Studio Code 中的 JSON 文件错误:应为逗号 json(514)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!