jsoncrack.com
jsoncrack.com copied to clipboard
Ability to copy path to node
Feature
When clicking on a node, display the option to copy the path to that node to the clipboard.
Possibly next to the "Clipboard" button:

Alternative solutions or implementations
No response
Other context
No response
hey, I can take care, could you clarify/confirm criteria?
My suggestion:
- add UI button (the same color as in clipboard + no icon)
- click to the button will will replace all clipboard data to path to the displayed node as a string with format TODO)
Alternative: we can display path to the node in the node modal header with clipboard button there
What exactly is meant by path here?
Example:
{ "one": { "two": { "three": 4 } } }
The path for "4" would be one.two.three.
Example:
{ "one": { "two": { "three": 4 } } }The path for "4" would be
one.two.three.
I faced the limitation for expected result:
- in the editor we have term "node" - it's represented as a independent block of data. In your example we don't have node
4but we have node{three: 4}

so the expected result will be one.two instead of one.two.three
not sure if it's achievable at all since all editor designed for this type of data representation. @AykutSarac please confirm
btw workaround to achieve the result is: { "one": { "two": { "three": [4] } } } in this case 4 will be represented as a node and path to it will be one.two.three
p.s. current api cannot handle element position by it's index, so in example {"prop": [1, 2, {c: [3]}]} path for 3 is prop.c
I think we can wait for #251 to be merged first, it changes whole parsing algorithm.