Questions tagged [jsonnode]

89 questions
0
votes
0 answers

How to create a function to map the JSON response to a list of Objects

I getting the response from the API { "Meta Data": { "1. Information": "Weekly Adjusted Prices and Volumes", "2. Symbol": "IBM", "3. Last Refreshed": "2021-05-19", "4. Time Zone": "US/Eastern" }, "Weekly…
Vic
  • 3
  • 2
0
votes
1 answer

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":"123", "a[1].b.c.d[1].e":"123", "d.e.f"="789", "x.y.z"="789" } I want to extract the keys having data in format…
username89
  • 51
  • 7
0
votes
0 answers

write jackson objectNode without escape characters

I wanted to remove escape characters while writing string. My code is as below. private static ObjectMapper objectMapper = new ObjectMapper(); public static JsonNode MyMethod() { InputStream cleanUp =…
Shabar
  • 2,617
  • 11
  • 57
  • 98
0
votes
2 answers

How to access the value from a key-value pair in a jsonnode

I have got a JsonNode like the below "{"Pink":["#000000"],"Red":["#000000"],"Blue":["#000000"],"Orange":["#000000"]}" and I am trying to get the value for Pink for e.g like this jsonNode.get("Pink").asText() But this isn't working - is there…
0
votes
0 answers

Reading a json file(approx 180 MB) without key names from S3 to a data class using object mapper (in kotlin)

My sample json in s3 looks like this : {"380682":{"ids":[380682, 765894, 9875086]},"1995539":{"ids":[1995539, 234567, 987654]}} I want to map it to List of Activities where: data class Activities( val key: String, val values:…
0
votes
2 answers

How to extract an array from a JsonNode?

I have the following input: I want to extract lat and long. I tried the following implementation, but I received null pointer exception for positionNode.get(i + 1).asDouble() private List getCoordinate(final JsonNode positionNode) { …
ela_ela
  • 49
  • 5
0
votes
0 answers

How can I convert from JsonNode to MultiValueMap spring boot (java8)

I have a spring boot project. Form data is posted to me by the client. I get this formData with MultiValueMap. Then I convert it to JsonNode and do something. As the last response, I need to return the JsonNode data I have to the server. How can I…
0
votes
1 answer

How to get LocalDate value in String format from JsonNode object?

I am trying to get date value from JsonNode. I have a car object which has car name and released LocalDate. public class Car { String carName; LocalDate released; } I need to convert it into JsonNode, so I am doing this way. ObjectMapper…
0
votes
1 answer

merging two ObjectNode

I want to merge two ObjectNode together, but with the best complexity. I aware about one way, I can use setAll method, but it returns JsonNode, therefore I must convert it. The best way that I found for the conversion procedure was How to convert…
SpongeBob
  • 383
  • 3
  • 16
0
votes
1 answer

How to replace json node in jsonNode or ObjectNode

I have a JSON node-like below. The structure of JsonNode will change dynamically. Now I want to replace/update the value of a particular key. Sample JSON One { "company": "xyz", "employee": { "name": "abc", "address": { "zipcode":…
Sangeetharaj
  • 169
  • 3
  • 14
0
votes
0 answers

Hazelcast - Query by field of a jackson ObjectNode object

I have a server and it receives a JSON format message from client, I cast this message to a jackson ObjectNode instance and store it into Hazelcast. This ObjectNode object has a field called 'traceId'. Now I want to search for all object in…
nguyenbkcse
  • 549
  • 1
  • 10
  • 20
0
votes
0 answers

Can't initialise a class instance from JsonNode with reflection

As I mentioned in the title. Here is my code below import java.lang.reflect.Field; import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.node.ObjectNode; public class ReflectClass { …
kenshinji
  • 2,021
  • 4
  • 25
  • 39
0
votes
2 answers

Recursive Json node update

I have a code where this help me to update the JSON node values. But, there is a small complexity in my way of handling. I have a Node that may come across any JSONObject. Note: Below is the sample json structure. { "Apple": { …
Danesh
  • 45
  • 10
0
votes
1 answer

Android App crashes when requesting HttpResponse

I'm currently developing a news app with FAROO Web Search, but when the app looks for the news with the API code it crashes. I don't think it's the API's fault because in the tests in RapidApi it works just fine. I've already added the internet…
0
votes
1 answer

Converting mapdifference to jsonnode

I am comparing two json document and is using mapdifference to get the difference of the two. Now i want to patch this difference to an existing json, but the difference returned is in the form /applicant/0/EmployDetail/0/AnnualSalary:…
anji
  • 1