98 questions
0
votes
1
answer
58
views
JsonNode not reading correct Node value
I am trying to read XML into a JSONNode so I can pull values from it. For some reason the .get() function is reading the wrong Node. This is the XML I am trying to read:
<order>
<order_ID&...
0
votes
1
answer
63
views
Need jsonNode.parse to do a case insensitive match in VB.Net
I can successfully parse the specific JSON data from a JSON file. The issue is that the file I am parsing is inconsistant with the letter case. So I need to do a case insensitive match instead of the ...
1
vote
1
answer
57
views
In VB.net 2022, I would like to use JsonNode to enumerate some subkeys without their values
This should be really simple, I think I am just missing the obvious, so I am asking for some help. I have a json file that I need to grab some subkeys and put them in an array. My code will show the ...
1
vote
2
answers
139
views
How do I know what kind of value or type (object, array etc.) a JsonNode represents?
Once I've converted a JSON stream/ document to a JsonNode, how do I discover what kind of JSON it represents?
For example, given a JsonNode how do I find out whether:
it is a JsonArray,
or a ...
0
votes
2
answers
122
views
JsonNode.HasProperty returns false when value is null
So I am writing a wrapper for JsonNode to easier extract json properties when there is no data-contract and I need to support a plethora of different values. But I am having some issues when it comes ...
0
votes
1
answer
66
views
JSON string wrapping within another JSON object
Below is my SMS class
public class SMS implements Notification {
private static final Logger LOG = LogManager.getLogger(SMS.class);
private static final Properties PROP = PropertyReader....
0
votes
2
answers
817
views
JsonNode - How to update nested values in array
Apologies, Google tells me there are many similar questions to this already asked on Stack Overflow but I'm struggling to find an answer that works for my situation.
I have a Java application that is ...
0
votes
2
answers
77
views
How remove key and value from json file in java
I have the next json file
I want remove key and value for ProductCharacteristic ->name.
How it can be done in Java?
[
{
"id": "0028167072_CO_FIX_INTTV_1008_P3909_IDX0",
"...
1
vote
2
answers
640
views
What is good form to write C# code in .net 8 to manipute a JsonNode object without compiler warnings about possible null-reference? [closed]
I'm working to become proficient with the newest C# language features and .net 8.
I understand that with C# 8.0 and above, the compiler will generate a warning when assigning to a reference type when ...
-2
votes
1
answer
327
views
The method getFields() is undefined for the type JsonNode [closed]
I'm new to Java. I had to replace the reference to org.codehaus.jackson.JsonNode library with com.fasterxml.jackson.databind.JsonNode to resolve security vulnerabilities. Now, I'm getting the above ...
0
votes
2
answers
232
views
Add data at child level in JSON Object
I want to merge JSON Object to master JSON Object at required depth
Master JSON
{
"data":{
"barrel":{
"length":100,
"stage":[0,1,2]
},
...
0
votes
2
answers
822
views
How to get all lines of JSON without knowing schema with JsonNode?
Let's say I am expecting a simple JSON response from an API like so:
{
"message": "Source: ",
"incomingUrl": "https://10.1.1/api/echo",
"...
2
votes
1
answer
477
views
How does one iterate a JsonArray with LINQ?
I have JSON:
{
"dimensions": [
{
"name": "dim1"
},
{
"name": "dim2"
},
{
...
0
votes
2
answers
1k
views
how to get the nested item of the json object using Java
I have the following json file test.json
{
"type" : "object",
"id" : "123",
"title" : "Test",
"properties" : {
"...
0
votes
1
answer
351
views
Regex to remove special characters from a Json node
I have a JSON node as below from which I need to remove all the values after # like DynamicAttribute#1279930005#ZZ8400 to DynamicAttribute
{
"uniqueCode": "ZZ",
"entity"...
2
votes
2
answers
779
views
How to have JsonNode.ToJsonString(...) produce properties in alphabetic order?
I am using JsonNode.ToJsonString(...) in my unit tests.
Unfortunately the property order in the serialized string seems to be depend the runtime order how the child nodes and value nodes were added.
...
-1
votes
1
answer
407
views
Append values from one JsonNode to another JsonNode field Java
I have two JsonNode objects, A and B, which both contain an identical field, "segments". I need to take the content from JsonNode object A and append it to the content from B. I need both ...
0
votes
3
answers
1k
views
How to add field names and values of a json object into List<String> using jsonNode
I have an expected json file as below. It is a nested object
{
"contact_info": [{
"contact_id": "Contact_001",
"contact_status": {
...
1
vote
1
answer
644
views
How to get JSON Object from JSONNode Array?
I have a JsonNode which looks like:
[
{
"ObjectIWantToRetrieve": {
"key0": {
"key1": {
"key2": "val3"
]
...
0
votes
1
answer
3k
views
How to check JsonNode value is empty or not : java
I want to check Jsonnode value is present or not,
As shown below myObj is an input. in this name is a key and "" is a value. I want to check if I get "" value then it should be go ...
0
votes
1
answer
696
views
Mapping ConsumerRecord to Element - What are JsonFactory and ObjectMapper equivalent for XML?
I have a function that takes in kafka ConsumerRecords<Object, Object> records and what I need to do is make an Element object out of each record.
Below is how it works for the Json ...
1
vote
0
answers
281
views
Issue retrieving an ISODate field from MongoDB in the correct format
We are running into issues retrieving MongoDB document using Spring JPA as it relates to MongoDB date field. Here is a document
{
"field1": "some value",
"field2":...
0
votes
2
answers
963
views
Traverse a JsonNode
This is how much JsonNode response has different key value pairs, similar to the example below. How can I traverse it to get the response in both key and value pair?
{
"message": "...
3
votes
1
answer
1k
views
How to save a JsonNode param (micronaut + kotlin) as a jsonb in postgres database
I'm trying to save an entity that has a JsonNode attribute and has to be converted to jsonb to be stores in a postgres database.
This is the database table:
CREATE TABLE IF NOT EXISTS ...
6
votes
1
answer
23k
views
How to create an empty JsonNode?
I am trying to set an empty node as a value of some other json node. new JsonNode() didn't work as that is protected.
Example:
JsonNode jsonNode = externalSource(); // <--This is the parent json ...
0
votes
1
answer
139
views
C# migrating to Core, how can I retrieve a System.Text.Json.JsonNode element so I don't have to use .ToString()?
I'm migrating code from .Net Framework to Core and without getting into the reason why I want to do this, I'll just keep it simple and focus on what I want to do.
Let's say I have a jsonString that ...
1
vote
0
answers
69
views
JsonNode request with other language letters gets 400 error java
I want to make a request with this link:
https://data.egov.kz/api/v4/gbd_ul/v1?apiKey=10232845919d49ac8eb22a8b8347fb1b&source={size:10,query:{bool:{should:[{prefix:{bin:"тов"}},{match:{...
0
votes
2
answers
538
views
Apply some condition on jsonnode and filter resultset in Java
I have an array of Jsonnodes. something like that
[
{
"coupon": "VAR",
"currency": "USD",
"sip": "94989WAX5",
"...
0
votes
2
answers
2k
views
How to efficiently merge two JSON Strings based on a common key
I have two JSON strings which are essentially arrays of JSONObject. The two JSON strings have below structure and keys:
JSON-1:
[
{
"title": "ABC",
"...
1
vote
1
answer
234
views
Filter Empty Objects in jackson ArrayNode class while serialization
I have a Json:
{
"field":[
{
"key":"123",
"name":"book1"
},
{}
]
}
I want to serialize this json to ...
1
vote
3
answers
2k
views
How to dynamically convert JSON to XML with custom namespace?
I try to convert a JSON into an XML with the following code
final ObjectMapper objectMapper = new ObjectMapper();
final XmlMapper xmlMapper = new XmlMapper();
JsonNode jsonNode = objectMapper....
1
vote
1
answer
2k
views
JsonNode.get("") returns null value. I want to take "name" and "forks" from json on code
RestTemplate restTemplate = new RestTemplate();
String resourceUrl = "https://api.github.com/orgs/engineyard/repos"; //json address
String response = restTemplate.getForObject(...
1
vote
1
answer
501
views
How to compare nested JsonNode field values with Java object parameter values in DROOLS?
I've been trying to execute a set of rules on a request object on the basis of some set of configuration value. Below is the example on what I am trying to do:
Configuration:
config.json
{
"...
1
vote
1
answer
2k
views
Load Data JSon in Unity
I'm trying to load the data.json file for a unity project.
I don't know where I went wrong.
I want to be able to load the level: level1, level2
I have tried some other ways but still not working.
Can ...
-1
votes
1
answer
50
views
How to load 10 levels assigned to 10 buttons in unity?
How to load list object Data in Unity?
I want 10 levels assigned to 10 buttons.
I think use jsonNode.
Hope everybody helps, please.
I don't want to do it like this. Does anyone have a faster way?
[...
0
votes
2
answers
8k
views
How do I get a value from a JsonNode array?
I have such a json response:
"data": [
{
"id": "1",
"login": "name",
"display_name": "dName&...
1
vote
0
answers
477
views
JsonNode remove empty nodes
I have a Dynamic JsonNode without POJO like this:
{
"Patient": {
"Addresses": {},
"Phones": {},
"Faxes": {},
"FirstName&...
0
votes
0
answers
244
views
Reading from a file but getting null in java
I want to read from a file and store it in a string.
This is my method:
public static String createJsonFileFromNode(String filename, JsonNode root) {
String dirName = "src/test/resources/...
2
votes
2
answers
3k
views
How to duplicate a JsonNode / JsonObject / JsonArray?
The new mutable JsonNode type has neither a Clone() nor a copy-constructor. How can I make a copy of one?
I tried to duplicate a shallow JsonObject (one filled with primitive key-value pairs) using ...
0
votes
1
answer
47
views
Treves the JSON object and manipulate the value in java
What im trying to do is
JSON:
{
aKey:{
aChildKey:""
},
bKey:""
}
expected:
aKey:{
aChildKey:"aKey.aChildKey"
},
bKey:"bKey"
}
Please ...
0
votes
1
answer
3k
views
spring-webflux : How to Extract user defined object from Mono<T> or Flux<T> from the response without blocking?
getUserDetails Method returns Mono of Type JsonNode. But I Actually want to return a Mono<User.java> or Flux<User.java>. please help modifying getBulkUserInfo or getUserDetails to get the ...
0
votes
1
answer
1k
views
Assertj not working with Jackson JsonNode
I'm using assertj and Jackson's JsonNode combined. So far I've been using Assertions.assertThat(objectNode0).isEqualTo(objectNode1); and everything works fine.
Now, I need to ignore some fields in the ...
13
votes
3
answers
44k
views
Cannot construct instance of `com.domain.User` (no Creators, like default constructor, exist): cannot deserialize from Object value
I have a controller that accepts ObjectNode as @RequestBody.
That ObjectNode represents json with some user data
{
"given_name":"ana",
"family_name": "fabry&...
0
votes
1
answer
4k
views
How can we iterate all subNodes of a jsonNode object?
I want to iterate through all nodes of a JsonNode object, And want fetch price details from below JsonNode object , Can some one help me how can we fetch below price details
response
{
"content&...
0
votes
1
answer
7k
views
Cannot invoke "com.fasterxml.jackson.databind.JsonNode.numberValue()"
Hi I'm trying to convert JSON data to class, I use the method of deserializing like that:
public class GroupDeserlialize extends StdDeserializer<Employe> {
public GroupDeserlialize()
{
this(...
0
votes
1
answer
7k
views
Adding new items to ArrayNode with updates in JsonNode
I was trying to add new array items to the JsonNode with updates in below code.
String request = "{\n" +
" \"item1\": 123,\n" +
" \"...
0
votes
1
answer
1k
views
How can i add additional field to each object in array node using jackson java?
i have list of masters that have two fields that are name and rating and after serialization to array node i need to add one more field to each object
for example i have json
[{"masterName":...
1
vote
1
answer
893
views
What is the cleanest way to unwrap nested JSON values with Jackson in Java?
I have a JSON which looks like this (number of fields heavily reduced for the sake of example):
{
"content": {
"id": {"content": "1"},
"param1&...
1
vote
1
answer
1k
views
Find the TYPE of any JSON element using its JSON Schema and Jackson Schema parser library in Java
I am trying to find the type of any element within the JSON Schema using the most memory efficient and high-performance approach. However, after reaching a certain point I am a bit stuck and running ...
0
votes
1
answer
801
views
Scala : Select the Jackson JsonNode keys using Regex filter in a json
I have sample jsonNode data - Inputstr =
{
"a.b.c.d.e":"123",
"a[0].b.c.d[0].e":"123",
"a[0].b.c.d[1].e":"123",
"a[1].b.c.d[0].e":&...