rest-book
rest-book copied to clipboard
add JSONView response renderer
for JSON response display with expand/collapse tree nodes for json documents, in addition to existing Data tab that should show formatted JSON doc.
see: https://github.com/tanhakabir/rest-book/issues/73#issuecomment-827007087
@tanhakabir now that I know how to work that </>
cell output renderer toggle, we can probably close this.
What I was looking for to see as a JSONView, which is one of the built-in mime type renderers :)
still would be nice to at least parse and format json data output in your custom Data tab:
yeah! I would still like to see a prettified view of the data in the Data tab for the custom output
I don't think we want to use online services for json view.
At the minimum, I think we should use null for replacer and 2 spaces when you stringify it in your custom data view.
vscode already has built-in color coded json renderer.
I suggest you do that and we close this ticket.
Sorry I misunderstood a previous comment, I'll remove my previous post as it's confusing.
I feel a built in renderer would be the best as it makes the response easier to read instantly without extra steps of copy/pasting. I use RestClient a lot and the response is rendered appropriately. If we can combine the response rendering of RestClient with your notebooks I think you'd have a perfect extension.
@asmith3006 just to clarify this version of the JSON view doesn't work well for you?
@tanhakabir can you format json data response in your default Data tab without switching to built-in json renderer?
I think that's what we are missing to avoid extra clicks to get to that picker, and be able to quickly view data returned in json format.
Personally, I don't care for color coded json as much as in built-in view, as long as I can read json response in Data tab, and copy/paste it elsewhere without running json reformat on it. That minimum change should work nicely for color blind folks like me who don't see those color coded highlights as well anyway.
Thanks!
Good point! Sure!
just an fyi I am using a restbook to test the leaflet map renderer I plan to work on. So far looks like we can use both just fine.
I just wish there was a way to set the default for some of those cell output mime types ...
@tanhakabir btw, you might want to try this: https://github.com/RandomFractals/vscode-data-table/issues/23#issuecomment-874833269
cool!
once you're happy with it, I can add your renderer as an optional dependency to my extension to view csvs
good idea. I need to patch my stdout replacement and will let you know when that update is ready to use.
Thanks!
@tanhakabir actually, you can add my data table renderer as a dependency for json and csv data display already.
I checked and my v1.1.0 should be able to parse and render both just fine.
see: https://github.com/RandomFractals/vscode-data-table/releases/tag/v1.1.0
... now with geojson data display too :wink: https://github.com/RandomFractals/vscode-data-table/releases/tag/v1.3.0
I've used https://www.npmjs.com/package/react-json-view in the past with success. It should work in preact, possibly with preact-compat
Imo a tabular view of json data is domain specific towards data science work and isn't nearly as common as people working with traditional REST APIs, so (unlike some degree of sane formatting of JSON responses 😉 ) I don't feel that such functionality needs to be built in.
@connor4312 I think it would be best if vscode provided an api to integrate built-in json, xml and other text editor views in notebook cell renderers, so we can use them for uniform user experience and focus more on creating custom renderers like that data table, which I think with some work can be used by other devs for REST response views, not just data scientists.
I've seen a number of data tables rolled into different notebook platforms in vscode, R & Py, and some attempts to standardize that with varying results.
So, I disagree with your views on tabular data display. In fact, I am surprised vscode still doesn't have a built-in data table component extension authors can use for data display.