Sublime Text plugin to get the JSONPath (a notation to access the item) under the cursor in a JSON.
The plugin also includes a command JSONPath: Copy to copy the displayed path to the clipboard.
Given the following JSON object:
{
"name": "Hello World",
"tags": [
"example"
],
"metadata": {
"author": "Alex Kirk"
}
}
In this scenario the plugin will display/copy the following JSONPaths:
- Cursor inside "name":
name
- Cursor inside "Hello World":
name
- Cursor inside "tags":
tags
- Cursor inside "example":
tags[0]
- Cursor inside "metadata":
metadata
- Cursor inside "author":
metadata.author
On PackageControl it's called Status Bar JsonPath
: https://packagecontrol.io/packages/Status%20Bar%20JsonPath
- Run
Package Control: Advanced Install Package
- Enter
Status Bar JsonPath
You can also install the package manually like this:
- Click the Preferences >Browse Packages… menu, this should open a folder
Packages
. - Download https://github.com/akirk/StatusBarJsonPath/archive/refs/heads/main.zip and extract it into that directory (it should then have a subfolder
StatusBarJsonPath-main
). - Restart Sublime Text.