1,868
questions
0
votes
0
answers
18
views
NestJS, OpenAPI, Spectral, and JSONPath for paths that include parameters
I'm using Spectral to lint my OpenAPI spec that is generated by my NestJS application.
I've implemented the URL Style Guidelines, which includes the resource-names-plural rule.
In general, plural ...
-2
votes
1
answer
51
views
JSONPath "$[length(@.foo)]" fails to return array length when tested via json-everything library
This seems like a simple use case. We are trying to obtain the number of items in an array using the JSONPath function length().
The test object is:
{
"array": [1,2,3]
}
The JSONPath ...
-2
votes
1
answer
73
views
Extracting data from JSON object by providing path
I am working on a project, where we have to call REST API's. Each API contains user information(name, email, status etc). Each API has its own response format and we have to extract the data out of ...
0
votes
1
answer
37
views
Unable to fetch JSON ARRAY elements by using jsonpath/ xpath in WSO2 EI / MI
I have sample JSON Payload shared below.
{
"multisetAttribute": [
{
"attributes": [
{
&...
0
votes
0
answers
16
views
org.apache.commons.lang3.SerializationException: oops while parsing JsonPath.parse
Stacktrace :
org.apache.commons.lang3.SerializationException: oops
at com.jayway.jsonpath.JsonPath.parse(JsonPath.java:647)
I am writing a test case in which I am parsing json string using jsonPath. ...
1
vote
1
answer
66
views
How to find object without existing property with JSONPath
I have the following json :
{
"data": [
{
"name": "Peter",
"excluder": 1
},
{
"name": "Sansa"
}
...
0
votes
0
answers
38
views
JSON Path - return array element satisfying regex AND string match condition with JsonPath.net
I am using system.text.json.nodes with JsonPath.net.
I have an array of four Json objects:
[
{
"Action" : [
{
"value" : "Home"
...
-1
votes
1
answer
30
views
Substitute elements of an array using JsonPath
I am using jsonpath-ng to substitute an element of an array. Given the yaml below:
paths
/api/v1/chats:
get:
- name: other_chats
in: query
required: false
type: ...
1
vote
1
answer
35
views
AssertionError: No value at JSON path "$.title" in Junit Mockito Test
Initializations:
@Autowired
private MockMvc mockMvc;
@MockBean
private ProductServiceImp productServiceImp;
@Autowired
private ObjectMapper objectMapper;
Test method for ...
0
votes
0
answers
30
views
Filter Expression for nested Arrays using JsonPath
I am trying to filter within nested json array.
My sample source json is:
{
"identifier": [
{
"type": {
"coding": [
...
1
vote
3
answers
87
views
Sorting on a nested field in a jsonb object whose parent key can be multiple values
I have a field that is of type jsonb that is structured like:
data
{ "prices": { "[parent key]": { "price": 20 } }}
[parent key] can be ...
0
votes
2
answers
70
views
Selecting a few fields from arrays of objects and flattening result
I am using Jayway JsonPath (version 2.9.0) Java library and trying to select a few fields from array of objects and flatten them to string array.
Input:
{
"data": [
{
"...
-1
votes
2
answers
53
views
Json Path - get all but last element of an array
I have a JSON array:
[
1,
2,
3,
4
]
I want to create a Json Path expression that returns all but the last element of the array, i.e. the result is:
[
1,
2,
3
]
There are ...
0
votes
1
answer
41
views
JSON path to test the value of a key
I want to test the value of a json object using jsonpath.
What should have been straightforward, doesn't seem to be. Here is the object:
{
"test_type": {
"id": "myId&...
0
votes
1
answer
91
views
Converting Memory Output from Ki to MB with JSON Path Query Output
I am running the below query to get two outputs across two columns :
Name
Memory
But the memory output is shown in Ki. I would like to convert the output of the node memory into MB when it is ...
1
vote
1
answer
45
views
Flatten values retrieved from any level of a JSON object
I have JSON objects that contain double values under the key value. However, sometimes those are nested, so data structures like this can exist:
[
{
"value": 0.1
},
{
...
0
votes
2
answers
45
views
Is it possible to use JSONPath with "?()" syntax to filter objects (not array) in Redis?
I'm using node-redis library. I have redis key: test1 with value:
{
"requests": [
{
"requestId": "123",
"requestType": "...
0
votes
1
answer
40
views
Athena extract value from nested json with dynamic key
I have following json
{"GrossORNet":"Net","Term":"Monthly","Tier":{"All":{"1":{"Max":"100000","Min":&...
0
votes
1
answer
45
views
Using JsonPath - how can I get the subset of properties of one object based on field names in another object (Jayway)
Given one object ("includeFields") specifying which properties from another object ("toBeFiltered") should be extracted into a new resulting object:
{
"toBeFiltered": {
...
1
vote
1
answer
93
views
Retrieve all array elements if child array contains a certain element in JSON/RediSearch
I am using Redis with RedisJSON module and RediSearch, and I have some entries such as those below.
JSON.SET uuid_1 $ '{ "type": "game1", "players": ["player1", ...
1
vote
1
answer
138
views
JSONPATH Typescript not picking up any values
I've got a JSON path with a condition to pull out if config item is valid based on the key name. When using https://jsonpath.com/, the path works, and it correctly picks out the correct value:
...
0
votes
2
answers
197
views
IBM Db2 Query Not Returning Expected Results for JSON Array Objects
I'm working with IBM Db2 (Version 11.5) and I'm trying to query JSON data stored in a column named data which contains an array of objects. However, my query using JSON_EXISTS does not return the ...
1
vote
2
answers
105
views
Filtering using Newtonsoft with multiple conditions in C#
I'm trying to extract values from json using Newtonsoft, but I'm having some problems.
Below is the json snippet I use:
{
"result": {
"areas": [
{
...
0
votes
0
answers
83
views
JSON Path Syntax using filters
So I was using a JSONPath syntax for the JSON below
{
"documents": [
{
"id": 1231,
"doctType": "FFS",
"...
0
votes
1
answer
54
views
jSONPath apply filter on a nested criteria within an array & retrive output from within matched array content
We have the following scenario, where we need to extract active flag from phones, only when it's an iPhone.
So essentially, parent.phones (if it contains an iphone) – extract the active flag.
{
&...
0
votes
1
answer
64
views
Using jsonb_path_query_first with a variable path
When the path is given, it works:
with x as
(select '{"a": {"b": {"c": "d"}}}'::jsonb data),
y as
(select '$.a.b.c'::text path)
select *,
...
2
votes
1
answer
79
views
How to get specific element of json array without using "WHERE" clause?
The database has a column with json objects in the form:
// row 1
[
{'id': 1, 'data': 'foo'},
{'id': 2, 'data': 'bar'},
{'id': 3, 'data': 'baz'}
]
// row 2
[
{'id': 1, 'data': 'fus'},
{'id':...
0
votes
0
answers
23
views
How can I use jsonpath expression to access the json content inside a Window.render() method in a json document?
For example:
[
{
"a": "Value1",
"b": "Value2",
"c": "Value1",
"d": "test.render({\"key1\":\"...
0
votes
0
answers
46
views
JsonPath evaluates to array but need string in response
I'm evaluating some JsonPath to find a single value, and the result is coming back as an array, but I need it to give a string value.
I have the following data
{
"id": 111,
"...
2
votes
1
answer
39
views
ordering logic of the returned json items list in the jsonb_path_query_first function?
As stated in the manual :
jsonb_path_query_first returns the first JSON item returned by the
JSON path for the specified JSON value
OK, but in which order are the json items evaluated ? As an ...
0
votes
0
answers
73
views
Combine N Json Objects Together in an array with AWS Step Functions or JSONPath
I have a JSON object with an array of N headers in it each in their own object like this:
{
"Headers": [
{
"HeaderName1": "HeaderValue1"
},
{
&...
1
vote
1
answer
70
views
get JSON object having specific key including root JSON object
Hi I'm struggling to find the JSONPATH expression to get all the JSON object having a specific key including the root JSON object.
For example:
{
"key1": 1,
"key2": 2,
&...
0
votes
1
answer
165
views
JsonPath (Jayway) efficient replacement
I am using Jsonpath in Java.
I have a simple json payload that can contain up to 100 different values.
I have to systematically read 70 of these values.
So I am iterating a list of the 70 paths and ...
0
votes
0
answers
90
views
JsonPath using Jayway - check value not exists in array
Given the following JSON:
{
"id": "0001",
"topping":
[
{ "id": "5001", "type": "None" },
{ ...
0
votes
1
answer
69
views
JSON Path for element sometimes in an array
I need a JSON path to an "element" when the "condition" is 1
{
"customer": [
{
"Addresses": {
"addressDetails": {
"...
0
votes
0
answers
21
views
Inconsistent JSON using Springboot
I'm currently learning Angular using Springboot as back-end. I have an issue with my JSON rendering of one specific entities.
The JSONPath to acess some data is changing from a id to another leading ...
0
votes
0
answers
81
views
Zabbix JSONpath LLD Discovery
I am trying to make discovering instances from https request. I have json like this:
{
"count": 2002,
"next": "http://.../circuits/circuits/...",
"previous&...
0
votes
0
answers
42
views
How to validate JsonPath using com.jayway.jsonpath library
I have the following json object,
{
"sampleList": [
{
"sampleName": "randomSampleName",
"sampleProperties": [
...
0
votes
1
answer
65
views
How to filter JSON objects using JSONPath when some objects may lack certain fields?
I'm currently working on filtering JSON objects using JSONPath, but I'm encountering an issue when some objects in the JSON structure may lack certain fields altogether. Specifically, I'm trying to ...
1
vote
1
answer
122
views
JsonPath returned wrong value in multiple threads
I did sample code below to check JsonPath version 2.9.0 thread safe or not, I realized it did not.
Is that the issue of JsonPath or there is any way to cope it? Or any alternative solution? Please ...
0
votes
1
answer
61
views
JsonPath expression not applying the condition
I'm recieving multiple Events (following JSON) from a Queue and I don't want to take all of them, only the events with Sales Organization="180C":
{
"eventID": "string"...
0
votes
1
answer
52
views
Get the parent item for a JSON Path
I am using some json path to update name references in fields and it is working great. Now we want a similar thing to return the references. I am trying to modify the same json paths to return the ...
0
votes
0
answers
48
views
How to SELECT FROM a given level of a JSON column in MySQL?
I got a JSON column (users.roles) with a structure like
{
"tenant-foo":
[
"role-aaa",
"role-bbb"
],
"tenant-bar":
[
&...
1
vote
2
answers
52
views
Separating the common name when extracting data from a json format
I do have this sample json data that I got from jsonplaceholder, a dummy rest api data. I am practicing display/fetching data to it.
Now, I am having a trouble when I am fetching the name of the ...
0
votes
1
answer
69
views
JsonPath, how to get the records' ids with the minimal value of an attribute?
I have the following json data:
{
"data": [
{
"ticket": "249 [DH-249]",
"id": 249,
"priority": 3,
"title": &...
0
votes
1
answer
146
views
How to retrieve a specific value using JSONPath with logical OR condition?
I have a JSON structure that may change a key:
{
"status": "ONLINE",
"meter": "A123",
"date": "2024-02-28T14:51:12"
}
OR
{
"...
2
votes
1
answer
68
views
How to accept any key in jsonb path?
I have a jsonb saved in a PostgreSQL database that has the structure:
{
"foo": {
"key0": {
"bar": "myValueA",
},
"key1": {
&...
0
votes
0
answers
376
views
How to resolve - This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider"
My application gets a Jackson JsonNode as an input and I am trying to access some fields from it using JsonPath. When I try to access the data, I hit the following exception
com.jayway.jsonpath....
1
vote
1
answer
71
views
Is there a json path filtering everything having a specific value?
I'm trying my hands at a, kind of, templating mechanism for JSON.
I have this reduced example JSON template
{
"type": "AdaptiveCard",
"body": [
...
2
votes
1
answer
163
views
What is the equivalent for JSONPath->$.*~ in duckDB?
What is the equivalent for JSONPath->$.*~ in duckDB ?
Example:
{
"firstName": "John",
"lastName": "doe",
"age": 26,
"address&...