-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement JsonViewer
widget
#479
Conversation
875f80a
to
28db80f
Compare
I feel like I would want to open level 2 or level 3 easily without giving complex jsonpath expression. @ramedina86 @madeindjs Would it be interesting to have a complementary
|
@FabienArcellier Yes I wasn't convinced that we needed paths in the first place but @madeindjs thought we should keep it I'm not in favor of keeping both but I'd prefer Fabien's approach one over the current path mechanism, unless @madeindjs can convince me with a solid use case. |
I am convinced it's interesting to keep it. I see a usecase for implementing search in huge json file. It allow advanced scenario for people. |
Ok let's keep the paths.
That'd be great, but let's do that at a different stage. @polymorpheuz is working on a bar to enable "Copy" in Annotated Text component, so once we merge that we can reuse and apply to this one. I'll create a ticket. |
Thanks for your feedback @ramedina86 & @FabienArcellier ! About the {
"foo": { "bar": "value" },
"others": [/* 1K items */]
} But,I don't know well the product to know if it's a solid use case. Also, little disclaimer, my implementation of the JSON path is a bit naive. It doesn't work for keys containing
I'm fine to implement @FabienArcellier 's idea or to not expose this setting for now. |
Good point about the dots, what we could do is use arrays
@FabienArcellier what do you think? |
If we don't follow Jsonpath or JMESPath (two json query standard), I would advocate we don't propose the feature yet. It would be too hard to explain and document for the user. If we want to propose this feature, I would advocate to use external library as jsonpath |
@madeindjs ok let's drop the open specific paths for now and go for @FabienArcellier's idea (as list of options)
|
Decision :
|
@ramedina86 & @FabienArcellier , I implemented the final modifications Screencast.from.2024-07-09.21-28-15.webm |
Implement a brand new
CoreJsonViewer
componentScreencast.from.2024-07-09.21-28-15.webm
This component uses new base components as:
BaseCollapsible
, a generic HTML<details>/<summary>
which can be reused laterBaseJsonViewer*
, some interns components to buildCoreJsonViewer