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
1
vote
2 answers

JsonPath: get root element depending on first level sub-element

I need all elements (including "id" and all attributes) of the json sample below where "type" has the value "state_machine_state", but only if "type" is on the first level. I don't want the middle element "order_transaction" in the result, although…
M4tee
  • 31
  • 4
1
vote
1 answer

use the results of a Query in JSON_EXTRACT or JSON_VALUE

Hi I don't know if this is possible, but I have some data in MySQL in the following structure : {"LinkId": "q1", "Answer": "Yes"},{"LinkId": "q2", "Answer": "Yes"},{"LinkId": "q3", "Answer": "No"} I can use JSON_SEARCH() to Retrieve the Position…
1
vote
1 answer

Unable to find jsonpath in deeply nested array with duplicate keys

I have a deeply nested json as below : [ [ { "heading": "Account Information", "columns": 2, "id": "01B5g000015Z7yeEAC", "rows": 8, "collapsible": false, …
Robin
  • 111
  • 2
  • 8
1
vote
1 answer

Is it possible to get all the paths of json strings stored in an SQL column

Say I have a JSON data stored in a varchar(max) column in a database. Is it possible to use SQL to get all the JSON paths present in that data. For example for the following JSON: { "dog": { "name":"Rover", "age": 6, …
SBFrancies
  • 3,987
  • 2
  • 14
  • 37
1
vote
1 answer

is there a way to sequentialize jsonpath search results in python

I have a very heavily nested json file with multiple blocks inside it. The following is an excerpt of the file, It has more than 6 levels of nesting like that { "title": "main questions", "type": "static", "value": { "title": "state your…
notsopeter
  • 11
  • 2
1
vote
1 answer

Rest assured - Invalid JSON expression: Script1.groovy: 1: Unexpected input: '['

I'm trying to retrieve the id of the workflow having "type":"system" using JSON expression Method: public static int getSystemWorkflowId(final Map cookies) { return…
1
vote
1 answer

JsonPath - Restrict To Research to One level

I am just trying JsonPath. It's great but I have a problem with a special case. I searched here but could not find a solution. So, my JSON file is below: [ { "id": 1, "images": [ { "id": 1,"url":…
agi31
  • 13
  • 2
1
vote
1 answer

How to get latest version of a product from a jsonb array?

Using PostgreSQL 12.7, I'd like to get the latest version of a product (maximum value) from a nested JSON array. Here is a sample value from column fields for product 'AAA': "customfield_01":[ { "id":1303, "name":"AAA -…
TNinja
  • 85
  • 1
  • 6
1
vote
1 answer

Jsonpath to grab parent field info with condition on child field

We can use jsonpath to select values for given expressions, for the following example and question: { "items": [ { "id": 1, "name": "item1", "album": { "name": "Summer Trip", "meta": [ { …
Drex
  • 3,346
  • 9
  • 33
  • 58
1
vote
0 answers

Validation fails when the array is null for karate jsonpath

The issue is with the validation. Here when I run the tests both the validations are passing, but I could see them in the response, the price is coming as null (price[]). My doubt is how its finding originalPrice when the price array itself is…
1
vote
1 answer

JSON Path - How to find the root elements based on child elements?

I have a JSON object, and I'm trying to find the root elements under it. Can someone please help me to figure this out? { "store" : { "10162021" : { "id" : 812340, "properties" : { "server" :…
rshdzrt
  • 125
  • 7
1
vote
1 answer

Unable to apply the ! not operator with JSONPath query to get nodes without taints

I'm trying to get the list of my Kubernetes cluster nodes based on some condition i.e. if Taint exists or not. I have 3 node cluster (1 master and 2 worker). I need to get the 2 worker node names as the taint is on master node. I'm stuck here as I'm…
vinod827
  • 1,123
  • 1
  • 21
  • 45
1
vote
1 answer

Solving this simple(?) JSONPath

I am new to this topic, but I hope you can help me. I can't figure out a correct JSON expression for solving my problem. Given JSON structure (coming from zigbee2mqtt): { "message" : "announce", "meta" : { "friendly_name" : "Lamp1" }, …
bearli
  • 73
  • 1
  • 2
  • 6
1
vote
1 answer

Json path extract based on multiple condition which include condition on child as well not working

I want to extract id where holder.parameter="jira-software-users" and "permission"="ADMINISTER_PROJECTS" I am using $.permissions[?(@.holder.parameter=="jira-software-users")]).id or $.permissions[?(@.permission=="ADMINISTER_PROJECTS")].id or by…
Shiv
  • 199
  • 5
  • 16
1
vote
1 answer

Jayway JSONPath Expession for Both Object and Array

I am having to trouble to retrieve value if parent element can be JSONArray as well as JSONObject. For that I used Deepcopy syntax to retrieve it. Now Problem is am getting additional values if child attribute exists in Inner Array…
1 2
3
11 12