JSONPath Flashcards

1
Q

What is JSONPath?

A

a query language that helps us in parsing the JSON data, which can be used for validation or assertions in a test.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

JSONPath Maven dependency

A

<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.4.0</version>
</dependency>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

JSONPath operator $

A

This is the root element and starting point for all path expressions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

JSONPath operator @

A

This is a filter predicate for the current node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

JSONPath operator *

A

This is a wildcard operator. It will return all objects regardless of their names or indexes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

..

A

This searches for the specified name recursively.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

.<name></name>

A

This is used for denoting the child element of the current element by name or index using dots ..

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

[‘<name>' (, '<name>')]</name></name>

A

This is used for denoting the child element of the current element by name or index using brackets [ ].

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

[<number> (, <number>)]</number></number>

A

This is used for denoting the array index of the element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

[start:end]

A

This is used for slicing the array based on start and end indexes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

[?(<expression>)]</expression>

A

This is a filter expression and must evaluate to a boolean value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly