Questions tagged [jsonpath]

JSONPath is a means of using XPath-like syntax to query JSON structures. Not to be confused with rest-assured's JsonPath implementation based on Groovy's Gpath. Use the [json-path-expression] tag for questions about JSON path expressions in general and for questions about JSON path expression DSLs.

JSONPath is a means of using XPath-like syntax to query JSON structures.

It is not a standard, but it does offer a means of querying JavaScript structures directly without needing to convert to or from XML.
JSONPath expressions always refer to a JSON structure in the same way as XPath expression are used in combination with an XML document.

Implementations:

Not to be confused with the standard of the same name by rest-assured: https://github.com/rest-assured/rest-assured/wiki/Usage#json-using-jsonpath

1786 questions
0
votes
1 answer

how to get with condition in jsonpath

Having json, provide below: [ { "delta": { "status": { "old": { "status": "Stop" }, "new": { "status": "Start" } } } } ] How I can get only delta which have new.status =…
millka_15
  • 369
  • 2
  • 10
0
votes
0 answers

Most Efficient way to find value in JSON . jsonpath.read vs jackson findvalue?

I have my JSON data stored in JsonNode. Which is the most efficient way to search for a field in this JsonNode? JsonNode.findValue() or I should use Jsonpath .read() Is JsonNode.findValue() internally de marshalling JSON to POJOs for finding…
0
votes
2 answers

Criteria inside JsonPath

I'm trying to filter jsonPath by type. To extract Integers I would expect this will return nothing as 'xx' is not integer: JsonPath.read("{'status': 'xx'}", "$.status", Criteria.where(".status").is(Integer.class)); Similarly…
Emiter
  • 268
  • 2
  • 13
0
votes
1 answer

Need help in finding specific error in a BlackBoard log file

I am troubleshooting a problem with a clients installation of our BlackBoard plugin. Per our request, we have been given some json formatted log files. These are very hard to read. I tried opening in an IDE, like VS Code, and they are too large for…
joshvito
  • 1,498
  • 18
  • 23
0
votes
2 answers

JSON parsing in python using JSONPath

In the JSON below, I want to access the email-id and 'gamesplayed' field for each user. "UserTable" : { "abcd@gmailcom" : { "gameHistory" : { "G1" : [ { "category" : "1", "questiontext" : "What is…
0
votes
1 answer

JSON Path conditional never seems to work - Unsure why

I cannot get this working in Newtonsoft JSON.net nor could I get this to work in any tester app I tried. I don't know why it's not working. Any variation I try fails. Can someone tell me what I'm doing wrong? { "Issue": { "Id": 50170, …
Thraka
  • 2,065
  • 19
  • 24
0
votes
0 answers

How to use JSONata with CARML?

May I ask if anyone tried to use JSONata4Java in CARML (https://github.com/carml/carml)? It needs to implement getSourceIterator() and getExpressionEvaluatorFactory(), which are in LogicalSourceResolver interface at…
Amjad
  • 1
0
votes
1 answer

Extending rules using SPectral

I am following Spectral's documentation and I am trying to add my custom rule as an extension to oas3 ruleset, it looks like rule from the documentation is completely ignored. My OpenApi 3.0 spec file: openapi: 3.0.2 info: title: Project info …
zolv
  • 1,720
  • 2
  • 19
  • 36
0
votes
1 answer

Karate framework text match startsWith as well as contains with OR clause

I am parsing a response for all the names object and it returns an array * def getName = response.source[*].name And print getName The api response looks like [print] [ "Map of USA", "Global map", "Check map of RSA" ] I want to match whether…
vdrulerz
  • 264
  • 3
  • 13
0
votes
1 answer

How can i get a max value for userId from this rest endpoint? I have to use RestAssured with Gpath syntax

I have to get a max value for userId using RestAssured and Gpath syntax. I dont know what i should type in body after then. I have tried so many ways but it does not work. @BeforeClass public void setUp() { endpoint =…
idzik
  • 1
0
votes
1 answer

Query for key with specific value from different objects of array in JSONPath

{ "dataObject": [ { "id": 263626, "role": { "id": 12054, "name": "Edit", "description": "" }, "resource": { "id": 5756, "type": "resource" } }, { "id":…
Santosh Hegde
  • 3,420
  • 10
  • 35
  • 51
0
votes
1 answer

Jsonpath array length validation issue

I am parsing an json and verify array length like below from("direct:parseJson") .setHeader("numberOfBooks").jsonpath("$..books.length()", int.class) .choice() .when( simple("${header.numberOfBooks} == '1'")) …
ImranRazaKhan
  • 1,955
  • 5
  • 33
  • 74
0
votes
1 answer

How to iterate json in each Flowfile in Nifi?

For example,there are 8 FFs,and then i’ve convert json to attribute for each FF,as follows: I've add 5 Properties and Value with EvaluateJsonPath in pic. If i need to convert 1000 multi-attribute,to set 1000 P/V with EvaluateJsonPath is too…
Cong
  • 479
  • 4
  • 16
0
votes
0 answers

Apache Camel restConfiguration, choice and jsonpath

Camel endpoint with choice and jsonpath works correctly when tried as an independent endpoint but when I introduce rest endpoint in route configuration choice stops filtering for the content-based routing of messages send from postman. Is there…
Vikrant
  • 63
  • 1
  • 1
  • 8
0
votes
1 answer

Checking if each object in JSON response contains a phrase in the particular field

Today I need to create an integration test for public API consumer and check if the records which I found matches the query param. For example, I am sending a GET request like localhost:8080/nutritionix/productDetails?query=grilled and I want to…
Martin
  • 1,139
  • 4
  • 23
  • 49