JSON Path in the response

Hi,

Recently I had to work on integration project where the API returned huuge responses (thousands of lines 10K even more sometimes)
I really miss a functionality like Json Path that could extract data from such requests.

What do you think?

2 Likes

Have you found a solution for this? Thank you.

https://learning.getpostman.com/docs/postman/scripts/test_examples

Would something like the following help you?

Check for a JSON value

pm.test("Your test name", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData.value).to.eql(100);
});

Jumping in here trying to understand the ask.

As @Whersh mentioned, if you want to interact with the JSON response body you can do so using something like this:
var jsonData = pm.response.json(); and from there you can work though the data.

You can then step up your game a bit using libraries like LoDash to put some of this into arrays and maps to assert on or set to variables to be used later on.

If we are off the mark on this, it would be good to know more about what you are looking to do so we can help out.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.