Questions tagged [jsonnode]
89 questions
1
vote
1 answer
How does one iterate a JsonArray with LINQ?
I have JSON:
{
"dimensions": [
{
"name": "dim1"
},
{
"name": "dim2"
},
{
"name": "dim3"
}
]
}
Loaded into JsonObject
JsonObject root =…

Chris Harrington
- 1,238
- 2
- 15
- 28
1
vote
1 answer
How to get JSON Object from JSONNode Array?
I have a JsonNode which looks like:
[
{
"ObjectIWantToRetrieve": {
"key0": {
"key1": {
"key2": "val3"
]
}
}
}
}
]
I wish to get the ObjectIWantToRetrieve out
The equivalent of…

Blake
- 157
- 4
- 13
1
vote
0 answers
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": {
"field2sub1": "some value",
"field2datefield":…

rwachter
- 23
- 3
1
vote
0 answers
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:{namekz:"тов"}},{match:{nameru:"тов"}}]}}}
If i pass this on…

Beigut Beisenkhan
- 31
- 6
1
vote
1 answer
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 string but in the serialized string i don't want the empty object : "{}".
I need to remove the empty…

aizen
- 11
- 1
1
vote
3 answers
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.readTree(jsonString);
String xmlString = xmlMapper
…

dank
- 21
- 3
1
vote
1 answer
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(resourceUrl,String.class);
ObjectMapper mapper = new…

SonyCZK
- 21
- 4
1
vote
1 answer
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
{
"company1": {
"site1": {
…

Mehul Chaturvedi
- 9
- 2
1
vote
1 answer
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 anyone review and fix the error for me.
I create…

Davil
- 11
- 4
1
vote
0 answers
JsonNode remove empty nodes
I have a Dynamic JsonNode without POJO like this:
{
"Patient": {
"Addresses": {},
"Phones": {},
"Faxes": {},
"FirstName": "Test",
"LastName": "Test",
"DateOfBirth": "5/5/1945 12:00:00 AM",
…

Amit
- 11
- 1
- 3
1
vote
2 answers
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 new JsonObject(original), but even this doesn't…

Qwertie
- 16,354
- 20
- 105
- 148
1
vote
1 answer
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": {"content": "A"},
"param2": {"content": "55"}
}
}
Keep in mind, that I don't have…

Rinkashikachi
- 123
- 11
1
vote
1 answer
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 out of ideas so hoping to get an answer…

BATMAN_2008
- 2,788
- 3
- 31
- 98
1
vote
1 answer
How to sort List alphabetically by a specific key using lambda .stream() in java
Below is the JsonNode which needs to be sorted alphabetically by key "size".
List listOfSizes =[{"size":"CAL KING","SKU_ID":"68454463"},
{"size":"KING","SKU_ID":"68454456"},
…

Pooja
- 47
- 6
1
vote
1 answer
Remove a nested JSON object with particular key, value with Jackson
I want to remove blob columns from JSON objects.
I need to check if any of the object has "@type": "blob", the entire column should be dropped.
Ex. following is a record from a DB. 'experience', 'hitpoints', 'name', 'uuid', 'image' (optional) are…

Siena
- 778
- 10
- 23