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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

filtering subarrays with jsonpath

I using jsonpath to get some properties and list of properties of an objet. For example, for this json I would like to get only the company name and the list of the first name of the staff : { "...
jeleb's user avatar
  • 633
0 votes
0 answers
18 views

JsonPath: find an element using a child element of an array

I have array of objects and I'd like to find an object by using a condition using a child element. For example, i want to get the value of the firstName if the value of phoneNumbers.type is "...
kenneth villorente's user avatar
-1 votes
0 answers
26 views

Find json path in a json string where a given matching text is found

I want to extract all JSON path expressions where a given matching text is found means values of each attribute in JSON are to be checked if that value contains the text provided. For example: ...
Sohit Jain's user avatar
0 votes
0 answers
23 views

How to match different properties in different locations within a list of JSON objects

What is the JSON path Syntax needed to match different properties in different locations within a list of objects. [ { "myObject": "obj1", "feilds": { &...
Arun Lal's user avatar
0 votes
1 answer
20 views

JsonPath- filter on child level in swagger file

Hi this is very short sample of my swagger file. I want to find paths which has x-policy with peerName's value is social. I have tried many jsonpaths but all of them encountered errors. I tested in ...
saba safavi's user avatar
0 votes
1 answer
41 views

JSONPath expression to get an object from an array based on condition

Given JSON structure { "total_institutions": 2, "count_by_institution": [ { "institution": { "id": "03629", "name&...
Bharath Sidda Reddy's user avatar
1 vote
3 answers
41 views

JSONPath within Cypress

I'm trying to get a JSON path for the HTML which has the language code DE Here is the sample JSON { "name": "Name", "text": "", "html": "HTML ...
TheKeyboarder's user avatar
-1 votes
1 answer
79 views

What's the difference between the PostgreSQL @? and @@ JSONB Operators?

I've been trying to understand the difference between the PostgreSQL @? and @@ JSONB operators. Why do these return different results? david=# SELECT '{ "email": { "main": "...
theory's user avatar
  • 9,226
0 votes
0 answers
32 views

Search inside JSON column of postgres (array)

hi i have json fields with values ["[email protected]", "[email protected]"] why this sql return nothing ? SELECT * FROM client WHERE emails ->> '$.[*]' like '%gma%'; try ...
Vitalik Tarnavskiy's user avatar
0 votes
1 answer
43 views

How parse JSON into Postman Flow?

I have next JSON: { "id": "0001", "type": "models", "name": "model_auto", "paths": { "/api/v1/vehicleModels":...
Владимир Костяник's user avatar
2 votes
2 answers
33 views

parameter inside a jsonpath expression in postgres

How can I use a parameter within a JSONPath expression in a PostgreSQL SQL query? I want to query something like this: SELECT * FROM table WHERE jsondata @@ '$.pathto.array[*].** ? (@.someproperty == &...
talam's user avatar
  • 23
1 vote
0 answers
53 views

How to get object's value if key name contains dots in jsonpath

The following code all returns False. import jsonpath data = {'layers': {'urlencoded-form.key': ["1234"]}} assert jsonpath.jsonpath(data, '$..urlencoded-form.key') == False assert jsonpath....
wgf4242's user avatar
  • 775
1 vote
1 answer
19 views

JSONPath Returning a parent element based on a child filter

I am trying to find a JSONPath expression to get the Itemid of every Item in a set if the Customer == 123 but the JSONPath is escaping me. Here is the JSON: { "Item:...
DIY Dan's user avatar
  • 11
-1 votes
1 answer
67 views

How to add data in existing json object in java using Jsonpath

below is json string : { "Data1": "", "Data2": { "id": 1234 }, "Data3": [ { "id": "id2", "price&...
Abhijit Sarkar's user avatar
1 vote
1 answer
34 views

JSONPath impossible to create a sort correctly

I begin with Json Path and I'm stuck. I would like have a list of the "names" of all persons who have "Registered" enter in "group_names". I try this path : $.data....
Olivier Sohy's user avatar
0 votes
0 answers
18 views

How do use json-path to select fields of a particular type?

Trying to render a Slack template in their blocks format which is json. I want to pull out text string to update them before sending off the message. The problem is that text can be an object or ...
gph's user avatar
  • 1,093
0 votes
1 answer
62 views

is it possible to extract concatenated values from json using JsonPath

is it possible to extract concatenated values from JSON using JSONPath? I want to get addresses from JSON array property as complete address lists. Here is my JSON input. It looks like {"...
pankaj agarwal's user avatar
0 votes
0 answers
38 views

Creating JSON document object model (DOM) using JSON Path (JayWay) in Java

I want to create a JSON String for a Map of JSON Path as key and the value is the JSON value itself. (It is somehow mentioned here as a solution) but neither 2.7 nor 2.8 version of Jayway's published ...
user2792012's user avatar
0 votes
0 answers
26 views

Jenkins generic webhook trigger: Json Path processing of filter expression results always returns a 'list'

I'm using the generic webhook trigger in Jenkins to respond handle bitbucket PR events. Here is an example json that is being sent from the webhook { "eventKey":"pr:opened", &...
Dave's user avatar
  • 2,829
0 votes
1 answer
24 views

how to define if one of kubernetes pods is not ready, using jsonpath and shell scripts?

I have a script with command that is sleeping if pods with specific labels is not ready. But it does not work if there are a few pods (in this way it need to be like condition != "true true true&...
annn's user avatar
  • 63
1 vote
1 answer
38 views

Are Nested filters supported by Newtonsoft in jsonpath expressions?

I looked at another qs. But the ans does not work with newtonsoft 13.0.3. I have posted my qs on github. Basically in a json like { "store": { "book": [ { ...
Raviraj Bhalerao's user avatar
0 votes
0 answers
29 views

JSONPATH conditional statement not showing any results

I'm trying to run a JSONPATH query to pull the IP from a JSON object which is nested within a much larger JSON dataset. I've got to the JSON object containing the IP. However, I want to filter out of ...
Anthony Quinn's user avatar
0 votes
1 answer
44 views

How to extract values from JSON using JSONPath expression

I have data in JSON format and it looks like this: { "book": [{ "category": "reference", "author": "Nigel Rees", "...
Krishna Madhav's user avatar
0 votes
1 answer
32 views

Parsing a Json response using Jayway JsonPath

i have the below Json structure, { "MyData": { "Type": "ABC", "Id": "567", "Number": "888" }, "RefId": ...
VinodKhade's user avatar
1 vote
1 answer
43 views

How to parse nested array in JSON using gojsonq

I have a JSON and want to parse the nested array using https://github.com/thedevsaddam/gojsonq { "total": 2, "page": 1, "pageSize": 50, "data": [ { ...
Programming-Lover's user avatar
0 votes
1 answer
70 views

Can I get more than just one key's value with JSONPath?

Here's a simplified (and syntactically not correct, because I stripped it) version of a JSON I'm currently dealing with: { "data": { "134001": { "id": 134001, ...
metawops's user avatar
  • 347
0 votes
1 answer
46 views

JSONPath find in list

Let's say I have a JSON like this: { "roles": [ "role1", "role2", "super_role1", "super_role2" ] } And I want to filter with ...
Jeremy D's user avatar
0 votes
1 answer
86 views

MQ to Kafka source connector filter

I am trying to configure a Kafka source connector to read messages from IBMMQ and route those messages to a Kafka topic. I am getting 2 types of messages, and value of the both message is a string. Eg:...
bluelabel's user avatar
  • 2,014
0 votes
2 answers
62 views

Equivalent of the $[*] jsonpath for SQL Server?

I would like to use a JSON path like $[*].name or $[..].name on a JSON like this one: [ {"id": 1, "name": "John"}, {"id": 2, "name": "...
celsowm's user avatar
  • 856
0 votes
1 answer
64 views

how to concat two value in jsonPath

i have a request like that; { "i0": "4299", "l2": "1788", "c1": "3", "l4": "0", "t35": &...
Erhan's user avatar
  • 23
0 votes
1 answer
29 views

jsonpath filter not working as expected in gatlign

In a gatling scenario I am using a jsonPath check to save a value. The json path expression is the following $.myentries[?(@.progs.length > 0)].users[*].id If I test it in an online evaluator on ...
jeleb's user avatar
  • 633
0 votes
2 answers
72 views

unable to get JSON elements inside nested array using jsonpath syntax

I am trying to get the departments id where location is USA in the following JSON { "datapoints": [{ "id": "default.1", "definedBy": ...
parlad's user avatar
  • 1,143
1 vote
1 answer
101 views

How to insert variable value into JSONPath string?

I have a function: CREATE OR REPLACE FUNCTION public.new_function1(arg1 text DEFAULT 'Miha'::text) RETURNS SETOF declarations LANGUAGE sql STABLE AS $function$ select * from declarations where data ...
Евгений Дружинин's user avatar
0 votes
0 answers
63 views

API Gateway request template JSONPath matching value with special characters

I'm attempting to do a direct integration between AWS API Gateway and AWS Eventbridge by using the AWSIntegration cdk class. Each request to the API Gateway endpoint should emit an event to the ...
lpbearden's user avatar
  • 110
0 votes
1 answer
87 views

How to obtain an array that contains eponymous empty array [] using JSONpath syntax?

I need to achieve recursively the last block of json-tree. (How do i understand that level is last in my case? It is the only that contains empty array Positions:[]). { "LocalVars": null, &...
AtomicBIM's user avatar
0 votes
1 answer
29 views

In JSONPath, how to find keys matching a 'non existing' filter?

Here is a json snippet containing a definition structure : { "Type": "page", "Label": "Test", "Children": { "crud": { "...
Cristof's user avatar
  • 26
0 votes
2 answers
26 views

Update value from json dictionary by key in MSSQL

I need to update a dictionary value in a field in a table that contains json in Microsoft SQL. So if the table and data is this: CREATE TABLE Visits ( [Id] UNIQUEIDENTIFIER NOT NULL, [...
JML's user avatar
  • 382
0 votes
0 answers
43 views

Build a object with JSONPath-plus

Is it possible use JSONPath-plus for build an object starting from empty object? EG: const data = {}; // start from empty object const updater = (cb: (value: string) => string): JSONPathCallback =&...
ar099968's user avatar
  • 6,977
3 votes
1 answer
76 views

How to Filter by a JSON Key Value Where the Key is Nested at Various Depths?

I have a large JSON response where I only need to update certain fields. Want to filter down the response, but the key/value pair I'm interested in is nested at varying levels. I tried to use the ...
anutter's user avatar
  • 366
1 vote
1 answer
58 views

jsonpath: it possible to combine results into an object?

With jq I can use add to combine results. I am looking for the jsonpath equivalent of this: $ json="{\"nodes\": [{\"code\": \"DE\", \"label\": \"...
Albert-Jan Roskam's user avatar
0 votes
1 answer
76 views

How to use a variable as jsonpath argument with kubectl

I am using a variable to store jsonpath query as follows: check_deprecating_api() { echo "Search for to be soon deprecated API" local API_REQUESTS_QUERY='"{range .items[?(@....
elmazzun's user avatar
  • 1,066
0 votes
1 answer
75 views

Filter object elements with Jayway Jsonpath

I have a list of (somehow "well-behaved") jsonpaths and I have to return an object which contains only the elements described in the list. For example, given the list ["$.a.a2", $....
dcolazin's user avatar
  • 992
0 votes
1 answer
133 views

Java | How can I create a list from a json using JsonPath RestAssured?

I have the following json and want to create a list from the display names, the json can have many different types not necessarily only 2: {"data": [ { "types": { "1&...
Mike Sky's user avatar
1 vote
1 answer
41 views

Java JsonPath: Insert object into another object

I am using the JayWay JsonPath to manipulate JSON objects. I want to insert a JSON object into a JSON array: ### before { "students": [] } ### after { "students": [{"id&...
Elias Strehle's user avatar
0 votes
1 answer
107 views

How can I use a customized function in JsonPath to set values for nested JSON objects in Java?

how to use Jsonpath to set values with a customized function for nested JSON objects the JSON objects is nested by unordered json array and json object such as { "store": { "...
Chris Paul's user avatar
1 vote
0 answers
137 views

JSONPath - How to get value from specific element of matched array

Let's say I have this JSON: { "toplevel": [ { "testval": "accept", "number": 1 }, { "testval&...
David Ranney's user avatar
0 votes
0 answers
68 views

How to write a jsonpath filter predicate which contains the IN operator within Postgres

I have a Expression within a SQL query which is looking for an object within a array and also use another property of the found object for another check. It works for an equality check: du.data @@ '$....
talam's user avatar
  • 23
0 votes
1 answer
45 views

JSONPath expression to find books having author name

I have the following json: { "books": [ { "id": 1, "name": "República Brasileira. de Deodoro a Bolsonaro - 2° Edição", ...
user2919910's user avatar
0 votes
0 answers
48 views

Cannot use 'in' operator to search for JSONPath Online Evaluator

Cannot use 'in' operator to search for JSONPath Online Evaluator. Can you you please help me why is throwing error message ? Is it syntax error ?
poovaraj's user avatar
  • 619
0 votes
0 answers
81 views

java.lang.AssertionError: No value at JSON path occurs when testing controller method

I wrote a test using JUnit 5 that passed successfully when the controller method returned a User in the response body. After modifying the method to return a UserDto the test fails with the following ...
Andreea Badea's user avatar

1
2 3 4 5
36