I get the "Expected Name at XX: YY" message in .json files in Eclipse. What's wrong?

Now I have this code ... with the string entra after closing} ...

Here is a great screenshot of it now!

{
  "menu" : {
    "id": "file",
    "value": "File",
    "popup": {
      "menuitem": [
        { "value" : "New", "onclick": "CreateNewDoc()" },
        { "value" : "Open", "onclick": "OpenDoc()" },
        { "value" : "Close", "onclick": "CloseDoc()" }
      ]
    }
  }
}
+6
source share
4 answers

You did not close }at the end of json. The correct json will be as follows.

{
  "menu" : {
    "id": "file",
    "value": "File",
    "popup": {
      "menuitem": [
        { "value" : "New", "onclick": "CreateNewDoc()" },
        { "value" : "Open", "onclick": "OpenDoc()" },
        { "value" : "Close", "onclick": "CloseDoc()" }
      ]
    }
  }
}
+2
source

Save the file in an eclipse, the error should disappear.

0
source

STS 3.9.4, Eclipse Oxygen. Json, Eclipse, - Json. , Spring Boot. , Eclipse JSON .

, , JSON, - fooobar.com/questions/1257108/....

0

Eclipse Photon, , , . .

, .

Eclipse, Ctrl + Shift + F, (Ctrl + Z) .

, .

0

Source: https://habr.com/ru/post/1663863/


All Articles