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

16,573

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.

Share:
16,573
MatheusEdnei
Author by

MatheusEdnei

Back-end developer. Works with Java. Study the javascript ecosystem.

Updated on June 04, 2022

Comments

  • MatheusEdnei
    MatheusEdnei almost 2 years

    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?

  • MatheusEdnei
    MatheusEdnei over 3 years
    Thanks! Solved the problem.