rest-book icon indicating copy to clipboard operation
rest-book copied to clipboard

CSV data request output doesn't set text/csv mime type

Open RandomFractals opened this issue 3 years ago • 4 comments

I tried GET with csv data file: https://github.com/RandomFractals/vscode-data-table/blob/main/data/usa-airports.csv

Your default Data renderer loads and shows that CSV data. However, I expected cell output to be of type text/csv, not application/json. Because of that I don't get an option to pick the CSV data mime-type for cell output rendering ...

image

RandomFractals avatar Jul 06 '21 16:07 RandomFractals

@tanhakabir see updated test restbook that shows correct request/response headers when you run second GET cell for CSV data request: https://github.com/RandomFractals/vscode-data-table/blob/main/notebooks/chicago-traffic-tracker.restbook

I still get json mime type output for that request too.

RandomFractals avatar Jul 06 '21 16:07 RandomFractals

to clarify, I don't have a csv renderer currently, woudl you expect as csv renderer that you have from the marketplace be the default or the builtin monaco renderer to be shown?

tanhakabir avatar Jul 12 '21 18:07 tanhakabir

I think you should set your cell output mime type to the response mime type and show your plain text in a data tab.

RandomFractals avatar Jul 12 '21 21:07 RandomFractals

@tanhakabir btw, any update when you can patch this? see this ticket in my repo that has more fixes: https://github.com/RandomFractals/vscode-data-table/issues/38

In general, I found that many notebook types don't set cell output mime type correctly for me to use that new output renderer api and grab the data I need based on mime type.

RandomFractals avatar Jul 16 '21 13:07 RandomFractals