Linked Questions

1 vote
0 answers
294 views

I have JSON that may look like this { "endpoint": { "status": "xxxx", "port": [ 123 ], } } or this { "endpoint": { "status": "xxxxxxx", "port": ...
yantaq's user avatar
  • 4,068
1 vote
0 answers
48 views

I'm fairly new to JSON parsing, I'm using the Retrofit library of Square and ran into this problem. I'm trying to parse this JSON reponse: [{ "contactName":"ABC", "addons"...
HaTr's user avatar
  • 11
30 votes
1 answer
31k views

How do I implement type TypeAdapterFactory in Gson? The main method of create is generic. Why? The registration method registerTypeAdapterFactory() does not receive type a type argument. So, how ...
Suzan Cioc's user avatar
  • 30.3k
3 votes
2 answers
4k views

I am using Gson to parse a JSON response from a certain API. Everything was working ok, but now seems like one of the fields of the response can come in an array form or in a single element form, so ...
codeKiller's user avatar
  • 5,778
3 votes
3 answers
5k views

How to parse answerData key from json response in kotlin as it is changing its type in each block? I tried keeping it Any but was not able to type cast. how to parse answerData? { "status": ...
Muhammad Irfan's user avatar
2 votes
2 answers
3k views

I am using Gson to convert JSON into a Java object. I have a field in the json that our wise services people coded as either an array or object depending on how many items come back in database. ...
JPM's user avatar
  • 9,365
1 vote
1 answer
2k views

I have a response from this api, and there is different response on ... "value": [ { "@unit": "C", "#text": "28" } ] sometimes &...
Zainal Fahrudin's user avatar
1 vote
4 answers
1k views

I need to parse a JSON file that contains long list of customers. In the JSON file each customer may have one id as a string: { "cust_id": "87655", ... }, or a few ids as an array: { "...
Jacob's user avatar
  • 1,255
0 votes
1 answer
231 views

I am consuming Thirdparty jsonString, I am trying to parse the json but sometimes JSON object "RadarReports" is an list and sometimes it object. {"RadarReports": { "...
sandy's user avatar
  • 13
0 votes
0 answers
214 views

When trying to process JSON, I recive Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 ...
Iñigo Dominguez's user avatar
0 votes
2 answers
148 views

I need a dynamic filtering criteria for querying west webservices using post. to give you an example. { "fields": [ "field":"firstName", "field":"lastName" ] ,...
user9978388's user avatar
0 votes
2 answers
200 views

I have been looking around but could not find any conclusion for my problem, I'll try to describe it the best way I can. I'm calling an API that can respond 2 ways (note that class names are only ...
Atram's user avatar
  • 11
2 votes
1 answer
72 views

I am using Retrofit with GSON for an app for a client, and I am having some trouble with some of my client APIs and I need to workaround this problem. Let's say i have an API which gives me telephones:...
Santiago Linietsky's user avatar