Questions tagged [jsonnode]

89 questions
0
votes
1 answer

Local variable value changing after passing it to method

I am using com.fasterxml.jackson.databind.JsonNode java library to parse a JSON and perform some manipulation on the JSON string as follows - public static void main(String[] args) { { String jsonString =…
Dhruv Saraswat
  • 858
  • 9
  • 13
0
votes
1 answer

Comma spit/delimit jsonnode in java

What is the best way to iterate through a comma delimited json node called 'name' in the scenario below? GetStoredValue result = dataManagerService.getStoredValue(itemId).checkedGet(); JsonNode node = mapper.readTree(result.getStoredString()); if…
ermalsh
  • 191
  • 1
  • 16
0
votes
0 answers

jackson.databind.JsonNode has() returning true on null fields(when it shouldn't)

when iterate through a List of JSONNODES like so for(JsonNode result: results){ if (predicate==Predicate.GREATER_THAN && result.has("JarVersion")){ //gets in here even though 'JarVersion' is null …
sf8193
  • 575
  • 1
  • 6
  • 25
0
votes
1 answer

Jackson Json: How to get multiple values with same name from json node java

I have a Json String that looks like this: { "generatedList1":{"myList":["1","2","3","4"]}, "generatedList2":{"myList":["1","6","8","2"]}, "generatedList3":{"myList":["1","12","3","11"]} } I want to collect all the values that are there in all…
AB Newbie
  • 1
  • 1
  • 2
0
votes
2 answers

Inside java stream the map function does not recognize my local variable

I am trying to search inside the flow of a jsonNode using the java stream. At one point I receive an ArrayNode and I have converted it to a List of JsonNodes using a simple private methode in my class; however, when I want to use the map fucntion to…
Eric
  • 91
  • 1
  • 6
0
votes
0 answers

JSON send as kafka producer message and consuming by spark structured streaming -parquet

I would like to know how to send a JSON string as message to kafka topic using scala function and Consumed by the using readstream() in spark structured streaming, save as parquet format. Currently using following code, but the parquet file not…
0
votes
3 answers

how to add attribute at any place in json using JsonObject in java

I have a json. Lets say: { "id":"101", "name":"Saurabh", "age":"28" } Now, I want to add "rollNo":"52" just after id attribute. How can I do that using jsonNode in java? Actually I am parsing this object using jsonNode, so no pojo mapping I…
Saurabh
  • 1
  • 1
-1
votes
2 answers

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" : { "_picnic" : { "type" : "boolean" .... I am able to get the first level value of the key using the following code. E.g.…
Dr. Mian
  • 3,334
  • 10
  • 45
  • 69
-1
votes
1 answer

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 the values from A and B in the final object. My code right…
Maria1995
  • 439
  • 1
  • 5
  • 21
-1
votes
2 answers

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. Thank you. { "message": "Results field contain api response", "results": { …
Tanu
  • 1,286
  • 4
  • 16
  • 35
-1
votes
1 answer

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? [Serializable] public class LoadLevel{ public…
Davil
  • 11
  • 4
-1
votes
2 answers

How to generated the csv file from json data with Java?

I try to generate csv file from json type data. These are my json test data. { "realtime_start":"2020-09-25", "realtime_end":"2020-09-25",, "units": "Percent", "seriess": [ { "name": "James", "age": 29, "house": "CA" …
Joseph Hwang
  • 1,337
  • 3
  • 38
  • 67
-1
votes
2 answers

Fetch only double types from JsonNode in java

I get the following JsonNode with JsonNode results = parentNode.get(GEOMETRY); yields results: "marks (79.89 90.78)" The problem is, I get the whole string "marks (79.89 90.78)" in results. But I need to fetch the doubles present inside () braces…
user101
  • 21
  • 2
-1
votes
1 answer

Issue trying to use JsonNode to access an external secured RESTful service

I am writing a Java class to access a third-party public REST API web service, that is secured using a specific APIKey parameter. I can access the required Json array, using the JsonNode API when I save the json output locally to a file.…
Beckteck
  • 65
  • 1
  • 10
1 2 3 4 5
6