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

1303 questions
-1
votes
1 answer

Returning specific propery from json where condition match

Im using rest-assured and try to access the id's where condition liked = false matches with restassured jsonpath. { "data": { "content": [{ liked=true, id=7fe9cb9a-51e9-e611-80bb-000c297d31d1 }, { liked=true, …
szabieable
  • 133
  • 2
  • 13
-1
votes
5 answers

Equivalent to "SELECT SUM(x)" query on JSON in Javascript

I have a JSON format with this format: var myJSON = { [ {"project":"4","value":"5"}, {"project":"2","value":"3"}, {"project":"4","value":"5"}, {"project":"4","value":"4"}, {"project":"1","value":"8"}, ] } I would like to do…
user411103
-1
votes
1 answer

Javascript - How to write json path when there's an integer tag

Javascript: var json_obj = { "1111": { "name": Bob, "id": 1 }, "2222": { "name": Alice, "id": 2 } } var first_name = json_obj.1111.name; // Gives me a missing ';' before statement error In above code,…
-1
votes
1 answer

JSON path reading

I have such question: In file i have multiple json lines like this {"id":1,"my_struct":{"other_id":1,"text":"HelloWorld0"}} {"id":2,"my_struct":{"other_id":12,"text":"HelloWorld1"}} {"id":3,"my_struct":{"other_id":123,"text":"HelloWorld2"}} I try…
UNIm95
  • 222
  • 3
  • 13
-1
votes
1 answer

replace the items instead of giving the whole path

In this json, when ever I find the following Items, I need to do the base64 encoding of the value and replace it with encoding value using javascript. For these Keys pbId, remmedId, remId, pbMedId. I need replace the corresponding values with their…
mnvbrtn
  • 446
  • 1
  • 5
  • 20
-1
votes
6 answers

How to get values from JSON start value like a?

I have a json like [ { "text": "Acute Myelocytic Leukemia" }, { "text": "Acute Myeloid Leukemia, Adult" }, { "text": "Dengue Fever" }, { "text": "Diphtheria" }, { "text": "Familial Cold Autoinflammatory Syndrome" }, { …
selvam
  • 1,153
  • 3
  • 18
  • 38
-1
votes
1 answer

Error in the format of JSON

I have a JSON with this format : [15:17:37,612] ({Rb:"0.6", I:[{id:"cost_reportings_timestamp", label:"cost_reportings_timestamp", type:"date", pattern:""}, {id:"Bureau de M. le Maire min-sum-cost_reportings_cost", label:"Bureau de M. le Maire",…
user2561233
-2
votes
1 answer

Insert JSON object using jsonpath in javascript?

Is there any way to insert a JSON object in the middle of another JSON object using jsonPath? I'm using Javascript in the Postman test script after I recieve a JSON object as a response, and I need to insert JSON data in the middle of the response.…
S. Liu
  • 11
  • 4
-2
votes
2 answers

Jmeter - extracting data using Json Path Extractor

I'm running a script in Jmeter and trying to extract data from the json returned, but I'm getting a WARN advice; however, using a Sampler I can see the content of the variable but when I'm using in a HTTP request Post or a IF controller, the…
-2
votes
2 answers

JSONPATH FOR saopui

Can you please let me know what will the jsonpath for below json: [{ "cpnSeqNbr": 0, "cpnStatusCd": 10, "cmpgnId": 37524, "cpnSkuNbr": 49579, "redeemEndDt": " " }] Regards, Rakesh
Rakesh A R
  • 31
  • 6
-2
votes
1 answer

How do I traverse through the JSON using a JSON path parser?

I have the following JSON response '{ "person_list": [ { "id": "4", "demographics": { "address": { "city": "Tokyo", "country": "Japan", "county_or_parish": "some county", "postal_code": "98765", "state_or_province": "some…
user3438489
  • 289
  • 4
  • 13
-4
votes
1 answer

How to extract JSON values that does not have attribute names?

{ "A1":{ "name":"Ad hoc", "projectId":0 }, "X2":{ "name":"BBB", "projectId":101 }, "AB":{ "name":"CCC", "projectId":102 }, "recordsCount":3 } For this JSON, how to extract values?…
Prakash Raj
  • 65
  • 1
  • 9
-4
votes
1 answer

jquery getJson method is not working in html

getJSON("sample.json") is not working when invoking from html in D:" { "name" : "blah" } getJSON("D:/data/sample_json.json",fun
siva
  • 13
  • 3
1 2 3
86
87