I would like to know whether this JSON script example I made is well formatted and whether it does make sense to put the information like this.
{"menu": {
"drinks": [
{"coke": "20"},
{"pepsi": "20"},
{"water": "20"}
],
"junk-food": [
{"hamburger": "40"},
{"fries": "20"},
{"pizza": "20"}
]
}}
I already validated the script with http://jsonlint.com/ but still I would like to a little more since I’m very new.
For some context on the use of the script, I’m going to parse the script with Python.
It is meant to organize elements of a GUI that will look more or less like this:

On the second window, a listbox similar to the first one will appear with the corresponding item and respective price.
- Is it correct JSON?
- Does this structure make sense?
The JSON is correct. The structure doesn’t have much semantic meaning though. I changed the structure so that it has more meaning and will be more manageable when attributes are added.
to save space you could do something like this too,