Closed yarikoptic closed 3 weeks ago
I am not sure there's anything for us to do here. For me:
In other words, this seems like something the user would have to configure (through plugins and settings) in order to add browser-level handling for JSON files.
The quantum leap would be for us to create our own in-DANDI JSON viewer but that seems very out of scope. Let me know what you think.
TL;DR: it is due to encodingFormat we (dandi-cli or user via API) uploaded in metadata for the assets. In dandi-cli we rely now on https://docs.python.org/3/library/mimetypes.html to guess and provide mime type within encodingFormat. In newer dandisets all is good for those .json files: e.g. going to https://dandiarchive.org/dandiset/000874/draft/files?location= I can view those jsons file and in metadata record encodingFormat says json. So the question now on what to do to fixup metadata records for other jsons already in the archive? e.g. could a simple script be written which goes and fixups all metadata records where path points to .json file and has encodingFormat that application/octet-stream
?
or could/should we provide in-code fixup... faster to be done than said:
So the question now on what to do to fixup metadata records for other jsons already in the archive? e.g. could a simple script be written which goes and fixups all metadata records where path points to .json file and has encodingFormat that application/octet-stream?
I think this is the way. Let me look into it.
@yarikoptic I think this is now fixed (the example in the issue description now properly renders the JSON content in my browser).
I'll close this issue but please re-open if there are lingering issues.
on https://dandiarchive.org/dandiset/000108/draft/files?location= clicking on the .json file which could be easily visualized by browser leads to download.
References: