JSON Array

can I create a json array without key? An example:

{

    [

        {

            "id":1,

            "name":"Otto Matic",

            "icon":"",

            "developer":"Pangea Software"

        },
        {

            "id":2,

            "name":"Minecraft",

            "icon":"",

            "developer":"Mojang"

        }

    ]

}
Answered by Scott in 717719022

Nope, that’s not valid JSON. The top level is an object (starts with curly brace) so it needs to contain keys and values. But you can have an array as the top level in the JSON document, like this:

[
    {"id": 1, "name": "Otto Matic", "icon": "", "developer": "Pangea Software"},
    {"id": 2, "name": "Minecraft", "icon": "", "developer": "Mojang"}
]
Accepted Answer

Nope, that’s not valid JSON. The top level is an object (starts with curly brace) so it needs to contain keys and values. But you can have an array as the top level in the JSON document, like this:

[
    {"id": 1, "name": "Otto Matic", "icon": "", "developer": "Pangea Software"},
    {"id": 2, "name": "Minecraft", "icon": "", "developer": "Mojang"}
]
JSON Array
 
 
Q