Skip to content
Advertisement

Tag: json

org.json.JSONException: Value {“storeid0”:[“1535″],”storeid1”:[“1862”]} at idddsss of type org.json.JSONObject cannot be converted to JSONArray

I am getting this response from my api {“idddsss”:{“storeid0”:[“1535″],”storeid1”:[“1862”]}} this is the code that I am using to get response from server and save all storeids in an array: But whenever i run the code i got following error, I don’t know why, I have parsed my code to JSONObject first and then to JSONArray and in loop I am

java.util.Date is parsing wrong dates with dates before 1912

I don’t understand the reason why Jackson library is parsing wrong dates before 1912. I suppose the problem is the java.util.Date conversion, because the problem persists with Gson. This is my code: date is a field of type java.util.Date As you can see, the input is: 1911-01-01T00:00:00+00:00 And the output is: Sun Jan 01 00:09:21 CET 1911 (I don’t understand

Jackson mixin is ignored on serialization and deserialization

I need to be able to create a Java POJO from a JSON object when I only have an interface that can’t be changed. I’m hoping that Mixins can help make this possible. I created a Mixin that hopefully will work but can’t get Jackson to use it. It appears that Jackson is ignoring the Mixin I am defining for

Jolt Transformation Spec for array of arrays [closed]

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 2 years ago. Improve this question I hava a json input and expected output is below. please help me in generating the spec. Input JSON: Expected Output JSON: please help me

Handle Response Kotlin Retrofit

I’m new to Kotlin and android development. Have been struggling to get my retrofit api to work. But have found a way to do it after some search on SO. I get the data response now, but I don’t know how to “separate” it, so that i can work around with it. this is my json response: and my model

How to send post request in java with a JSON body

I am confused as to how to send a post request in Java with JSON parameters. I have seen many examples that use HttpPost library which I can not access. Below is my code: } class main { I am trying to pass the json in the main method (I know I am not doing it right), and was wondering

Advertisement