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

Add example with array at top level #18

Closed
bethesque opened this issue Mar 23, 2015 · 2 comments
Closed

Add example with array at top level #18

bethesque opened this issue Mar 23, 2015 · 2 comments

Comments

@bethesque
Copy link
Member

v1 and v2

@abhayachauhan
Copy link

I'd love to see a test case of using matchers on an array at the top level of the body.

Eg:

"body": [
{
"eventId": "45d80d13-d5a2-48d7-8353-cbb4c0eaabf5",
"timestamp": "2014-06-30T01:37:41.0660548",
"eventType": "SearchView"
},
{
"eventId": "83f9262f-28f1-4703-ab1a-8cfd9e8249c9",
"timestamp": "2014-06-30T01:37:52.2618864",
"eventType": "DetailsView"
},
{
"eventId": "3e83a96b-2a0c-49b1-9959-26df23f83aeb",
"timestamp": "2014-06-30T01:38:00.8518952",
"eventType": "SearchView"
}
]

Should the matcher for eventId in the first index be:
"$.body.[0].eventId": { "match": "type" }
or
"$.body[0].eventId": { "match": "type" }

@uglyog
Copy link
Member

uglyog commented Jun 11, 2015

"$.body[0].eventId": { "match": "type" } is the correct form. I'll add examples.

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

No branches or pull requests

3 participants