Visual Studio Code 中的 JSON 文件错误:应为逗号 json(514) [英] JSON file error in Visual Studio Code: Expected comma json(514)

查看:42
本文介绍了Visual Studio Code 中的 JSON 文件错误:应为逗号 json(514)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆