views:

26

answers:

1

I googled a bit with no luck. I'm wondering if a tool exists that allows a user to paste in a chunk of valid JSON, click on any of its elements, and get returned the id (path) to that element. I prefer either a web app, a Chrome extension, or a OSX or X11 app. Windows would be last resort as I'd have to run it under Crossover. I could also use a FireFox extension though I'd prefer Chrome.

The application would work like so, if I pasted in:

{"accounting":[{"firstName":"John","lastName":"Doe","age":23},{"firstName":"Mary","lastName":"Smith","age":32}]"sales":[{"firstName":"Sally","lastName":"Green","age":27},{"firstName":"Jim","lastName":"Galley","age":41}]}

and clicked on 'Sally', it would return: employees.sales[0].firstName

There are some similar tools for XML that I've tinkered with over the years on various platforms. Anyone know if anything like this exists for JSON?

A: 

Kind of answering my own question here, I just found that you can do this in a bit of a roundabout way using the Firebug Addon for FireFox. If you enable the Net tab, and then browse the JSON data, then right-click the element and choose "Browse in Dom Tab", you can then right-click on an element and choose "Copy Path."

I'll keep poking around and see if I can find anything for Chrome, etc.

EDIT: updated instructions for Firebug.

k00k