minio / console

Simple UI for MinIO Object Storage :abacus:
https://min.io/docs/minio/linux/index.html
GNU Affero General Public License v3.0
856 stars 282 forks source link

JSON object (Content-Type application/json) not previewing in the console #3019

Closed choucavalier closed 1 year ago

choucavalier commented 1 year ago

Expected Behavior

The console should allow previewing JSON objects (maybe up to a certain size).

The JSON string should be prettified for better readability.

Current Behavior

No preview is possible for application/json objects. You can only download the file.

Your Environment

MinIO VERSION 2023-08-23T10:07:06Z

Rocky Linux 9

Docker Hub image (latest)

vokamut commented 1 year ago

Similar problem Expect heading: Content-Type: application/json Heading given: Content-Type: application/octet-stream

vokamut commented 1 year ago

Old jsion files are returned successfully. Оnly the new ones have a different header

prakashsvmx commented 1 year ago

JSON file type is not supported for preview. only image, audio, video are supported.

mnowaczyk commented 10 months ago

JSON file type is not supported for preview. only image, audio, video are supported.

Can you explain why? It's just text, the browser is perfectly capable of displaying it.

harshavardhana commented 10 months ago

JSON file type is not supported for preview. only image, audio, video are supported.

Can you explain why? It's just text, the browser is perfectly capable of displaying it.

Our choice, JSON can be a bigfile that can negatively impact normal operations. If we concentrate unnecessarily previewing such content. We do this already for videos and audio.

What we are providing is already an artisanal functionality. It does what is presented.

mnowaczyk commented 10 months ago

Why is JSON considered likely to be bigger than plain text? If I upload entire War and Peace by Tolstoy and set the mime type to text/plain, the preview will work. On the other hand, if I upload 'null' with content-type application/json, I cannot preview these 4 bytes. This is not reasonable and certainly not 'artisanal'.

choucavalier commented 10 months ago

siding with @mnowaczyk here. previewing JSON data would be useful. even if trimmed.

matutter commented 9 months ago

@harshavardhana is the project open to a MR to restore support for JSON preview? And perhaps a flag to enable it so that JSON previews are not available by default.

GXMark commented 7 months ago

I'm currently using MinIO for my MMO object storage solution and I love it but not having a JSON previewer is ultra annoying to me since alot of my development is checking JSON file content that its ID reference fields match up. Can i suggest an option to preview json file text like was suggested with a user definable size limit?

I've also used couchbase and that has a super json preview facility on its documents.

harshavardhana commented 7 months ago

It is what it is; you can send a PR without assurances on merging it. To avoid more bike shedding on this topic, we are locking this issue.