Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I’m trying to read data from JSON file in AndroidStudio with a format as follows: I wan…
Tag: json
How to replace a value of the given key path in dynamic json object using java
I have dynamic JSONs and their key-path, I need to change the values of the Json on received key paths As an example, in have below JSON and key (cars.car1) I need to change the value of cars.car1. as “Benz”. Also Please Note JSON body and its keys will change from time to time. As an example, nex…
How to create Array of Objects using the Jackson Streaming API
I am trying to create a JSON using the Jackson Streaming API. I know how to create an array of elements in JSON using Jackson as we have plenty of examples related to it. But I am a bit confused about how to create an array of Objects using it. Following is the JSON structure that I would like to
Deserialization of JSON and Avro without Schema
I have been trying to implement Avro deserialization without confluent schema registry. A quick research shows that I can embed the schema in header before sending the record to topic. But the schema again has to be serialized to bytes before embedding on the header which again makes this problematic. Is ther…
I am trying to convert Xml doc to java obj.Its showing array index out of bounds exception fro the parameter serviceproviders
error Exception in thread “main” java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 0 at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) at java.base/jdk.intern…
Looking for a template engine which supports JsonPath (Java)
I’m developing a microservice (let’s call it email microservice) which generates emails from HTML templates. Basically, the client sends a json with some data to the email microservice, and based on that data it has to generate an email (populate fields in html template with values coming in the j…
Spring Jackson deserialize object with reference to existing object by Id
I have three entity classes of the following: Shipments Entity: Shipment Details Entity: Product Entity: I am receiving JSONs through a rest API. The problem is I do not know how to deserialize a new Shipment with shipmentDetails that have relationships to already existing objects just by ID. I know you can s…
How do I search for a particular object within an array of JSON objects using postman
How do I query for a particular BusStopCode from within a JSON object in a JSON array for example if I want to find only the first object then the bus stop code I would query is 01012 my current URL query request looks like this- http://transport/dataservice/BusStops?BusStopCode=01012 here http://transport/da…
App crashes when connection is lost while using HttpUrlConnection
i’m making a class that get json data from an external url, it is working fine if there is a connection. also shows an error if there isn’t. the problem is if the connection lost while the class is getting data the app crashes. here is my code: so guys is there any solution to prevent the app from…
Connect two HashMap Values
I’ve got this JSON string: String json = “{“countries”:{“2″:”China”,”3″:”Russia “,”4″:”USA”},”capitals”:{“2″:Beijing,”4″:null,”3″:Moscow}}”; I converted string …