Questions tagged [json-path-expression]

A JSON path expression is an expression, possibly in a domain-specific language, specifying a path to to one or more values within a JSON text. The expression may include filters.

Javascript provides a well-known notation for JSON path expressions. JSONPath and JMSEPath are well-known DSLs for JSON path expressions. In jq, any JSON array consisting solely of strings and/or integers can be used as a path expression.

179 questions
0
votes
1 answer

jsonPath - problem with accessing to field by index

I trying access to value Carrier by taking value from shipping_id. I testing queries at https://www.jsonquerytool.com/. If I type key by hand $.shipping_methods["11"] or $.shipping_methods.11I receive correct result ["Carrier"]. But I have problem…
jasufo
  • 33
  • 4
0
votes
1 answer

JsonPath array length() returns number of keys instead of elements

I have the following array: "books" : [ { "title" : "History", "id":1 }, { "title" : "The Robotics", "id":2 }, { "title" : "The World", "id":3 } ] and my JsonPath notation is this: $.books[?(@.title == 'History')].length() . I'm…
sparrow2
  • 147
  • 1
  • 11
0
votes
1 answer

How to extract objects in Jmeter using JSONPath extractor

Hello i am using Jmeters JSONPath extractor, and the i am trying to extract certain fields from a response which is structured like the JSON below. I am trying to only extract the names of the child objects and not the details inside them, so…
KurryF
  • 73
  • 1
  • 1
  • 5
0
votes
1 answer

How to create JSON object from JSON node path in C#

I want to map JSON path properties from key-value pairs to generate the JSON object in C# where the path contains nested array index path Input: Dictionary properties = new Dictionary(); properties.put("id",…
Himanshu Dwivedi
  • 7,934
  • 3
  • 31
  • 52
0
votes
1 answer

Apache Camel test and assert the JSON body field value with JSON Path Expression

I'm trying to check the field value of the body which is a JSON string with JsonPathExpression. In the example below, the JsonPathExpression checks whether or not the root JSON object has the field named as "type". What I want to achieve is, to…
Levent Divilioglu
  • 11,198
  • 5
  • 59
  • 106
0
votes
1 answer

JsonPath selecting object field if multiple condition matches

{ "userName": "test" "customer": { "mode": "BANK", "modeDetails": { "accountNo": "12345678901001", "walletId": "11324354@paypal" } } } I am using jsonpath to select accountNo if…
Kurukshetran
  • 75
  • 2
  • 12
0
votes
1 answer

JSON Path Combining

I have a json file like…
0
votes
1 answer

Extract values from web service JSON response with JSONPath

I have a JSON response from web service that looks something like this : [ { "id":4, "sourceID":null, "subject":"SomeSubjectOne", "category":"SomeCategoryTwo", "impact":null, "status":"completed" }, { …
arnisli
  • 41
  • 3
0
votes
1 answer

Need to Extract all data based on condition in jmeter

I got below json as response from HttpRequest of jmeter. [ { "state": { "data": { "linearId": { "externalId": null, "id": "1234" }, …
Viswa
  • 3
  • 2
0
votes
2 answers

How to get json path for the given requirement?

I need to find json path for the given json structure { "name": "ninja", "contry": "India", "Account": [ { "id": "123", "orgId": 223, "investment": [ { "invetmentId": "111", "name": "India…
Ninja
  • 433
  • 3
  • 10
0
votes
1 answer

Need to add a list of in JSON via JSON Patch

I have been reading about JSON Patch. However, I cannot find a solution to my problem. I have a JSON which I need to add a list. For example: { "orders": "food" } I need to inject this list of items below the orders attribute. { "items": [ { …
Yejin
  • 541
  • 2
  • 15
  • 32
0
votes
2 answers

jsonPath Expression for json and json of json parameter using NIFI expression Langauge

I have json like below, { "name1" : "Aks", "address1": { "area" : "area1", "location1": "loc1" }, "phonenum": "1445452" } I need to retrieve all keys and from address1 only location1 parameter. I tried, $.*,…
aksy91
  • 107
  • 1
  • 1
  • 9
0
votes
1 answer

how to make jsonpath work for name-value pair

I have json like the one i have attached. I want to read id under processorMap, if processorMap.id matches to the criteria. for e.g. if i search value "set value for mongo" then I should be getting => 1c9b2d18-e9ab-3512-803a-c1ee5f7a2793 I tested my…
Rakesh Prasad
  • 602
  • 1
  • 13
  • 32
0
votes
1 answer

Extract an element value in json using jsonpath

Following is my json data { "primary": [ { "secondary": { "name": { "fullname": "fullname1" }, "alias": "alias1" }, "reference":…
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