How to build/modify a scene from files

Hello everyone, first of all you should note that I am a total newbie when it comes to glTF, I would appreciate any help with these questions:

1 - In the structure of a glTF file, must there be a specific order of the arrays?
for example, “meshes” must come before or after “accessors”, or does it not matter?

2 - Do the declarations of each type of array have to be only once with all the declarations together or could I “partition” them? for example, could I have the “meshes” declaration like this?

"meshes" : [
       {
           "name" : "mesh1",
           "primitives" : [
                blablabla
           ]
       },
]

"accesors" : [
blablabla
]


"meshes" : [
       {
           "name" : "mesh2",
           "primitives" : [
                blablabla
           ]
       },
]

3 - Is there any tool (GUI or by command) to join 2 glTF by manipulating the content of the files, I know it can be done by copy & paste but, maybe, some tool that helps with the modification of the references to the indexes and the data offsets?

Thanks in advance.
D.

JSON associative arrays do not have ordering. This is a fundamental part of the file format. Since glTF is based on JSON, it carries this over.

2 - Do the declarations of each type of array have to be only once…

Duplicate keys in the same top-level JSON object would be a problem, you’ll want to avoid that.

3 - Is there any tool (GUI or by command) to join 2 glTF by manipulating the content of the files, …

You could import multiple glTF files into Blender and then export the whole scene to one glTF. The gltf-transform scripting library or CLI would also be an option:

gltf-transform merge a.glb b.glb output.glb

When working with glTF files in a programming language, you’ll probably want to at least use a library for reading/writing JSON, or even a library designed for reading/writing glTF. VSCode also has a plugin for viewing, editing, and validating glTF JSON by hand.