1

Is there any syntax for a json path query to return the root object?

To quote Goessner on the subject:

Since a JSON structure is usually anonymous and doesn't necessarily have a "root member object" JSONPath assumes the abstract name $ assigned to the outer level object.

So I'd really expect just "$" to return the root object... But it doesn't. It returns false.

I need a way to get the root object in a query (seems silly I know but the application I am using only allows me to specify a jsonpath query to access items in JSON).

1

1 Answer 1

5

$ does return the root object for Jayway, Gatling and Nebhale.

Looks like the equivalent in Goessner is $..

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.