The application/json output for file_server doesn’t enclose the array elements in [ ] (so, some things don’t read it as valid JSON).
It would also make the results usable by more programs if the array was named (I used the name “files” as an example).
The following is an example of what the JSON output current looks (no outer braces, no array brackets, and no name for the array).
{
"name": "XXDV-BV-JV-Oaklan.fit",
"size": 25467,
"url": "XXDV-BV-JV-Oaklan.fit",
"mod_time": "2022-01-14T13:36:26.3597617Z",
"mode": 438,
"is_dir": false,
"is_symlink": false
},
{
"name": "DV-BV-JV-Oaklan.fit",
"size": 25467,
"url": "DV-BV-JV-Oaklan.fit",
"mod_time": "2022-01-14T13:36:26.3597617Z",
"mode": 438,
"is_dir": false,
"is_symlink": false
}
The new lines below are what I’m suggesting should be added to the JSON directory listing output.
{
"files":[
{
"name": "XXDV-BV-JV-Oaklan.fit",
"size": 25467,
"url": "XXDV-BV-JV-Oaklan.fit",
"mod_time": "2022-01-14T13:36:26.3597617Z",
"mode": 438,
"is_dir": false,
"is_symlink": false
},
{
"name": "DV-BV-JV-Oaklan.fit",
"size": 25467,
"url": "DV-BV-JV-Oaklan.fit",
"mod_time": "2022-01-14T13:36:26.3597617Z",
"mode": 438,
"is_dir": false,
"is_symlink": false
}
]
}