JSON file error in Visual Studio Code: Expected comma json(514)
Asked Answered
T

2

4

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

         }

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?

Tenet answered 13/1, 2021 at 20:42 Comment(0)
F
4

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"
}

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.

Fabio answered 13/1, 2021 at 20:48 Comment(0)
S
-2

make string with json like this:

{ "attribute": "// numeroConta", "operator": "=", "value": "0030152201" }

Stern answered 31/7 at 8:0 Comment(1)
This is the same as the other answer from 2021Jordans

© 2022 - 2024 — McMap. All rights reserved.