Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple values for JSON PATH #853

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

niusounds
Copy link

Related #197

I want to get user ids from this response:

{
  "payload": {
    "results": [
      {
        "user": {
          "id": "aaa",
          "name": "alice",
          "iconUrl": "https://foo/bar"
        },
        "isFollowed": false,
        "isFollowing": true
      },
      {
        "user": {
          "id": "bbb",
          "name": "alice",
          "iconUrl": "https://foo/bar"
        },
        "isFollowed": false,
        "isFollowing": true
      },
      {
        "user": {
          "id": "ccc",
          "name": "alice",
          "iconUrl": "https://foo/bar"
        },
        "isFollowed": false,
        "isFollowing": true
      }
    ]
  }
}

with

@userIds = {{search.response.body.$..user.id}}

expected result is ["aaa","bbb","ccc"] (string). So I can send userIds with next request

POST some/api

{
  "userIds": {{userIds}}
}

Works as usual if JSON path is matching to only one element.

@evanportwood
Copy link

@Huachao is there any possibility of getting this PR completed? This would be really helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants