Retrofit: D/Response: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $GSON throwing “Expected BEGIN_OBJECT but was BEGIN_ARRAY”?Retrofit Expected BEGIN_OBJECT but was BEGIN_ARRAYRetrofit: Expected BEGIN_OBJECT but was BEGIN_ARRAYRetrofit - MongoDB - Expected BEGIN_ARRAY but was BEGIN_OBJECTRetrofit2 Android: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $Retrofit Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 pathRetrofit: Expected BEGIN_ARRAY but was BEGIN_OBJECTRetrofit 2 “Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $”retrofit error : Expected BEGIN_OBJECT but was BEGIN_ARRAYExpected BEGIN_ARRAY but was BEGIN_OBJECT Android Retrofit
What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?
How do I fix the group tension caused by my character stealing and possibly killing without provocation?
Does "he squandered his car on drink" sound natural?
How does electrical safety system work on ISS?
How to preserve electronics (computers, iPads and phones) for hundreds of years
Multiplicative persistence
How to get directions in deep space?
Has any country ever had 2 former presidents in jail simultaneously?
Stack Interview Code methods made from class Node and Smart Pointers
How can ping know if my host is down
Pre-mixing cryogenic fuels and using only one fuel tank
How do you make your own symbol when Detexify fails?
Permission on Database
Why does Carol not get rid of the Kree symbol on her suit when she changes its colours?
When were female captains banned from Starfleet?
What is the English pronunciation of "pain au chocolat"?
Mimic lecturing on blackboard, facing audience
Biological Blimps: Propulsion
Can I cause damage to electrical appliances by unplugging them when they are turned on?
What is the highest possible scrabble score for placing a single tile
Do we have to expect a queue for the shuttle from Watford Junction to Harry Potter Studio?
Does grappling negate Mirror Image?
Microchip documentation does not label CAN buss pins on micro controller pinout diagram
How to draw a matrix with arrows in limited space
Retrofit: D/Response: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
GSON throwing “Expected BEGIN_OBJECT but was BEGIN_ARRAY”?Retrofit Expected BEGIN_OBJECT but was BEGIN_ARRAYRetrofit: Expected BEGIN_OBJECT but was BEGIN_ARRAYRetrofit - MongoDB - Expected BEGIN_ARRAY but was BEGIN_OBJECTRetrofit2 Android: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $Retrofit Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 pathRetrofit: Expected BEGIN_ARRAY but was BEGIN_OBJECTRetrofit 2 “Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $”retrofit error : Expected BEGIN_OBJECT but was BEGIN_ARRAYExpected BEGIN_ARRAY but was BEGIN_OBJECT Android Retrofit
I want to get the first "City" object from this JSON response from a URL (or get them all as an array and then use .map() operator in RxJava to get the first city):
totalResultsCount: 5,
names: [
city: stockholm
,
city: oslo
,
city: london
,
city: moscow
,
city: mumbai
]
Here is code responsible for getting this:
public interface MyApi
@GET("searchJSON?")
Observable<City[]> getPopulation(
@QueryMap Map<String, String> queries
);
and this class
public class MyApiService
private final String baseUrl = "myapiurl";
private MyApi api;
private final Gson gson;
private final OkHttpClient okHttpClient;
public MyApiService()
gson = new Gson();
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
okHttpClient = new OkHttpClient();
okHttpClient.newBuilder().addInterceptor(httpLoggingInterceptor);
buildApi();
private void buildApi()
api = new Retrofit.Builder()
.baseUrl(baseUrl)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build()
.create(MyApi.class);
public Observable<City> getPopulation(String city)
return api
.getPopulation(city)
.map(c -> c[0])
.subscribeOn(Schedulers.io());
When I call getPopulation from an activity, I get this message:
D/Response: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column
2 path $
Here is how my City class looks like:
public class City
@SerializedName("city")
private String name;
public City(String name)
this.name = name;
Any ideas?
EDIT:
I tried adding a custom deserializer like:
public class MyDeserializer implements JsonDeserializer<City>
@Override
public City deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
JsonElement cities = json.getAsJsonObject().get("names");
return new Gson().fromJson(cities, City.class);
and changing to:
gson = new GsonBuilder()
.registerTypeAdapter(City.class, new MyDeserializer())
.create();
but I still get the exact same response as earlier.
add a comment |
I want to get the first "City" object from this JSON response from a URL (or get them all as an array and then use .map() operator in RxJava to get the first city):
totalResultsCount: 5,
names: [
city: stockholm
,
city: oslo
,
city: london
,
city: moscow
,
city: mumbai
]
Here is code responsible for getting this:
public interface MyApi
@GET("searchJSON?")
Observable<City[]> getPopulation(
@QueryMap Map<String, String> queries
);
and this class
public class MyApiService
private final String baseUrl = "myapiurl";
private MyApi api;
private final Gson gson;
private final OkHttpClient okHttpClient;
public MyApiService()
gson = new Gson();
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
okHttpClient = new OkHttpClient();
okHttpClient.newBuilder().addInterceptor(httpLoggingInterceptor);
buildApi();
private void buildApi()
api = new Retrofit.Builder()
.baseUrl(baseUrl)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build()
.create(MyApi.class);
public Observable<City> getPopulation(String city)
return api
.getPopulation(city)
.map(c -> c[0])
.subscribeOn(Schedulers.io());
When I call getPopulation from an activity, I get this message:
D/Response: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column
2 path $
Here is how my City class looks like:
public class City
@SerializedName("city")
private String name;
public City(String name)
this.name = name;
Any ideas?
EDIT:
I tried adding a custom deserializer like:
public class MyDeserializer implements JsonDeserializer<City>
@Override
public City deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
JsonElement cities = json.getAsJsonObject().get("names");
return new Gson().fromJson(cities, City.class);
and changing to:
gson = new GsonBuilder()
.registerTypeAdapter(City.class, new MyDeserializer())
.create();
but I still get the exact same response as earlier.
Delete my answer because it is Rx question I thougth the problem was JSON, try to add the relevant information using the wrapper class mentioned
– cutiko
Mar 8 at 12:07
@cutiko your answer was kinda helpful too. I managed to solve this by changing GET method and my getcities method and add some relevant RxJava methods. Thanks for your help.
– Carlton
Mar 8 at 12:53
Welcomr, post the solution then
– cutiko
Mar 8 at 13:29
add a comment |
I want to get the first "City" object from this JSON response from a URL (or get them all as an array and then use .map() operator in RxJava to get the first city):
totalResultsCount: 5,
names: [
city: stockholm
,
city: oslo
,
city: london
,
city: moscow
,
city: mumbai
]
Here is code responsible for getting this:
public interface MyApi
@GET("searchJSON?")
Observable<City[]> getPopulation(
@QueryMap Map<String, String> queries
);
and this class
public class MyApiService
private final String baseUrl = "myapiurl";
private MyApi api;
private final Gson gson;
private final OkHttpClient okHttpClient;
public MyApiService()
gson = new Gson();
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
okHttpClient = new OkHttpClient();
okHttpClient.newBuilder().addInterceptor(httpLoggingInterceptor);
buildApi();
private void buildApi()
api = new Retrofit.Builder()
.baseUrl(baseUrl)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build()
.create(MyApi.class);
public Observable<City> getPopulation(String city)
return api
.getPopulation(city)
.map(c -> c[0])
.subscribeOn(Schedulers.io());
When I call getPopulation from an activity, I get this message:
D/Response: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column
2 path $
Here is how my City class looks like:
public class City
@SerializedName("city")
private String name;
public City(String name)
this.name = name;
Any ideas?
EDIT:
I tried adding a custom deserializer like:
public class MyDeserializer implements JsonDeserializer<City>
@Override
public City deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
JsonElement cities = json.getAsJsonObject().get("names");
return new Gson().fromJson(cities, City.class);
and changing to:
gson = new GsonBuilder()
.registerTypeAdapter(City.class, new MyDeserializer())
.create();
but I still get the exact same response as earlier.
I want to get the first "City" object from this JSON response from a URL (or get them all as an array and then use .map() operator in RxJava to get the first city):
totalResultsCount: 5,
names: [
city: stockholm
,
city: oslo
,
city: london
,
city: moscow
,
city: mumbai
]
Here is code responsible for getting this:
public interface MyApi
@GET("searchJSON?")
Observable<City[]> getPopulation(
@QueryMap Map<String, String> queries
);
and this class
public class MyApiService
private final String baseUrl = "myapiurl";
private MyApi api;
private final Gson gson;
private final OkHttpClient okHttpClient;
public MyApiService()
gson = new Gson();
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
okHttpClient = new OkHttpClient();
okHttpClient.newBuilder().addInterceptor(httpLoggingInterceptor);
buildApi();
private void buildApi()
api = new Retrofit.Builder()
.baseUrl(baseUrl)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build()
.create(MyApi.class);
public Observable<City> getPopulation(String city)
return api
.getPopulation(city)
.map(c -> c[0])
.subscribeOn(Schedulers.io());
When I call getPopulation from an activity, I get this message:
D/Response: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column
2 path $
Here is how my City class looks like:
public class City
@SerializedName("city")
private String name;
public City(String name)
this.name = name;
Any ideas?
EDIT:
I tried adding a custom deserializer like:
public class MyDeserializer implements JsonDeserializer<City>
@Override
public City deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
JsonElement cities = json.getAsJsonObject().get("names");
return new Gson().fromJson(cities, City.class);
and changing to:
gson = new GsonBuilder()
.registerTypeAdapter(City.class, new MyDeserializer())
.create();
but I still get the exact same response as earlier.
edited Mar 8 at 11:39
Carlton
asked Mar 7 at 23:42
CarltonCarlton
95321638
95321638
Delete my answer because it is Rx question I thougth the problem was JSON, try to add the relevant information using the wrapper class mentioned
– cutiko
Mar 8 at 12:07
@cutiko your answer was kinda helpful too. I managed to solve this by changing GET method and my getcities method and add some relevant RxJava methods. Thanks for your help.
– Carlton
Mar 8 at 12:53
Welcomr, post the solution then
– cutiko
Mar 8 at 13:29
add a comment |
Delete my answer because it is Rx question I thougth the problem was JSON, try to add the relevant information using the wrapper class mentioned
– cutiko
Mar 8 at 12:07
@cutiko your answer was kinda helpful too. I managed to solve this by changing GET method and my getcities method and add some relevant RxJava methods. Thanks for your help.
– Carlton
Mar 8 at 12:53
Welcomr, post the solution then
– cutiko
Mar 8 at 13:29
Delete my answer because it is Rx question I thougth the problem was JSON, try to add the relevant information using the wrapper class mentioned
– cutiko
Mar 8 at 12:07
Delete my answer because it is Rx question I thougth the problem was JSON, try to add the relevant information using the wrapper class mentioned
– cutiko
Mar 8 at 12:07
@cutiko your answer was kinda helpful too. I managed to solve this by changing GET method and my getcities method and add some relevant RxJava methods. Thanks for your help.
– Carlton
Mar 8 at 12:53
@cutiko your answer was kinda helpful too. I managed to solve this by changing GET method and my getcities method and add some relevant RxJava methods. Thanks for your help.
– Carlton
Mar 8 at 12:53
Welcomr, post the solution then
– cutiko
Mar 8 at 13:29
Welcomr, post the solution then
– cutiko
Mar 8 at 13:29
add a comment |
2 Answers
2
active
oldest
votes
Your custom deserializer uses getAsJsonObject("names") but names is a JsonArray in your json response.
names: [] // This is a JsonArray
names: // This is a JsonObject
1
Any suggestions how i could parse to return city array from my get method?
– Carlton
Mar 8 at 11:56
add a comment |
I manage to solve this.
I changed my API calls to:
@GET("searchJSON?")
Observable<ResponseBody> getPopulation(
@QueryMap Map<String, String> queries
);
And I changed my api call method to:
public Observable<City> getPopulation(String city) {
return api
.getPopulation(city)
.map(c -> c.getCities().get(0))
.subscribeOn(Schedulers.io());
And I changed my Serializeble POJOs to:
public class ResponseBody implements Serializable
@SerializedName("totalResultsCount")
@Expose
private int totalResultsCount;
@SerializedName("names")
@Expose
private List<City> cities = null;
public ResponseBody()
public ResponseBody(int totalResultsCount, List<City> cities)
super();
this.totalResultsCount = totalResultsCount;
this.cities = cities;
public int getTotalResultsCount()
return totalResultsCount;
public void setTotalResultsCount(int totalResultsCount)
this.totalResultsCount = totalResultsCount;
public List<City> getCities()
return cities;
public void setNames(List<City> cities)
this.cities = cities;
and
public class City implements Serializable
@SerializedName("name")
@Expose
private String name;
public City()
public City(String name)
super();
this.name = name;
public String getName()
return name;
public void setName(String name)
this.name = name;
And I complete removed the custom Deserializer.
It was a combination of my POJO and Wrong choice of RxJava operations which led to my problem. I hope this answer might help someone in the future.
If anyone have a better solution/way to handle this I would appreciate comments.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054579%2fretrofit-d-response-expected-begin-array-but-was-begin-object-at-line-1-column%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your custom deserializer uses getAsJsonObject("names") but names is a JsonArray in your json response.
names: [] // This is a JsonArray
names: // This is a JsonObject
1
Any suggestions how i could parse to return city array from my get method?
– Carlton
Mar 8 at 11:56
add a comment |
Your custom deserializer uses getAsJsonObject("names") but names is a JsonArray in your json response.
names: [] // This is a JsonArray
names: // This is a JsonObject
1
Any suggestions how i could parse to return city array from my get method?
– Carlton
Mar 8 at 11:56
add a comment |
Your custom deserializer uses getAsJsonObject("names") but names is a JsonArray in your json response.
names: [] // This is a JsonArray
names: // This is a JsonObject
Your custom deserializer uses getAsJsonObject("names") but names is a JsonArray in your json response.
names: [] // This is a JsonArray
names: // This is a JsonObject
answered Mar 8 at 3:37
Mauro CurbeloMauro Curbelo
986
986
1
Any suggestions how i could parse to return city array from my get method?
– Carlton
Mar 8 at 11:56
add a comment |
1
Any suggestions how i could parse to return city array from my get method?
– Carlton
Mar 8 at 11:56
1
1
Any suggestions how i could parse to return city array from my get method?
– Carlton
Mar 8 at 11:56
Any suggestions how i could parse to return city array from my get method?
– Carlton
Mar 8 at 11:56
add a comment |
I manage to solve this.
I changed my API calls to:
@GET("searchJSON?")
Observable<ResponseBody> getPopulation(
@QueryMap Map<String, String> queries
);
And I changed my api call method to:
public Observable<City> getPopulation(String city) {
return api
.getPopulation(city)
.map(c -> c.getCities().get(0))
.subscribeOn(Schedulers.io());
And I changed my Serializeble POJOs to:
public class ResponseBody implements Serializable
@SerializedName("totalResultsCount")
@Expose
private int totalResultsCount;
@SerializedName("names")
@Expose
private List<City> cities = null;
public ResponseBody()
public ResponseBody(int totalResultsCount, List<City> cities)
super();
this.totalResultsCount = totalResultsCount;
this.cities = cities;
public int getTotalResultsCount()
return totalResultsCount;
public void setTotalResultsCount(int totalResultsCount)
this.totalResultsCount = totalResultsCount;
public List<City> getCities()
return cities;
public void setNames(List<City> cities)
this.cities = cities;
and
public class City implements Serializable
@SerializedName("name")
@Expose
private String name;
public City()
public City(String name)
super();
this.name = name;
public String getName()
return name;
public void setName(String name)
this.name = name;
And I complete removed the custom Deserializer.
It was a combination of my POJO and Wrong choice of RxJava operations which led to my problem. I hope this answer might help someone in the future.
If anyone have a better solution/way to handle this I would appreciate comments.
add a comment |
I manage to solve this.
I changed my API calls to:
@GET("searchJSON?")
Observable<ResponseBody> getPopulation(
@QueryMap Map<String, String> queries
);
And I changed my api call method to:
public Observable<City> getPopulation(String city) {
return api
.getPopulation(city)
.map(c -> c.getCities().get(0))
.subscribeOn(Schedulers.io());
And I changed my Serializeble POJOs to:
public class ResponseBody implements Serializable
@SerializedName("totalResultsCount")
@Expose
private int totalResultsCount;
@SerializedName("names")
@Expose
private List<City> cities = null;
public ResponseBody()
public ResponseBody(int totalResultsCount, List<City> cities)
super();
this.totalResultsCount = totalResultsCount;
this.cities = cities;
public int getTotalResultsCount()
return totalResultsCount;
public void setTotalResultsCount(int totalResultsCount)
this.totalResultsCount = totalResultsCount;
public List<City> getCities()
return cities;
public void setNames(List<City> cities)
this.cities = cities;
and
public class City implements Serializable
@SerializedName("name")
@Expose
private String name;
public City()
public City(String name)
super();
this.name = name;
public String getName()
return name;
public void setName(String name)
this.name = name;
And I complete removed the custom Deserializer.
It was a combination of my POJO and Wrong choice of RxJava operations which led to my problem. I hope this answer might help someone in the future.
If anyone have a better solution/way to handle this I would appreciate comments.
add a comment |
I manage to solve this.
I changed my API calls to:
@GET("searchJSON?")
Observable<ResponseBody> getPopulation(
@QueryMap Map<String, String> queries
);
And I changed my api call method to:
public Observable<City> getPopulation(String city) {
return api
.getPopulation(city)
.map(c -> c.getCities().get(0))
.subscribeOn(Schedulers.io());
And I changed my Serializeble POJOs to:
public class ResponseBody implements Serializable
@SerializedName("totalResultsCount")
@Expose
private int totalResultsCount;
@SerializedName("names")
@Expose
private List<City> cities = null;
public ResponseBody()
public ResponseBody(int totalResultsCount, List<City> cities)
super();
this.totalResultsCount = totalResultsCount;
this.cities = cities;
public int getTotalResultsCount()
return totalResultsCount;
public void setTotalResultsCount(int totalResultsCount)
this.totalResultsCount = totalResultsCount;
public List<City> getCities()
return cities;
public void setNames(List<City> cities)
this.cities = cities;
and
public class City implements Serializable
@SerializedName("name")
@Expose
private String name;
public City()
public City(String name)
super();
this.name = name;
public String getName()
return name;
public void setName(String name)
this.name = name;
And I complete removed the custom Deserializer.
It was a combination of my POJO and Wrong choice of RxJava operations which led to my problem. I hope this answer might help someone in the future.
If anyone have a better solution/way to handle this I would appreciate comments.
I manage to solve this.
I changed my API calls to:
@GET("searchJSON?")
Observable<ResponseBody> getPopulation(
@QueryMap Map<String, String> queries
);
And I changed my api call method to:
public Observable<City> getPopulation(String city) {
return api
.getPopulation(city)
.map(c -> c.getCities().get(0))
.subscribeOn(Schedulers.io());
And I changed my Serializeble POJOs to:
public class ResponseBody implements Serializable
@SerializedName("totalResultsCount")
@Expose
private int totalResultsCount;
@SerializedName("names")
@Expose
private List<City> cities = null;
public ResponseBody()
public ResponseBody(int totalResultsCount, List<City> cities)
super();
this.totalResultsCount = totalResultsCount;
this.cities = cities;
public int getTotalResultsCount()
return totalResultsCount;
public void setTotalResultsCount(int totalResultsCount)
this.totalResultsCount = totalResultsCount;
public List<City> getCities()
return cities;
public void setNames(List<City> cities)
this.cities = cities;
and
public class City implements Serializable
@SerializedName("name")
@Expose
private String name;
public City()
public City(String name)
super();
this.name = name;
public String getName()
return name;
public void setName(String name)
this.name = name;
And I complete removed the custom Deserializer.
It was a combination of my POJO and Wrong choice of RxJava operations which led to my problem. I hope this answer might help someone in the future.
If anyone have a better solution/way to handle this I would appreciate comments.
answered Mar 8 at 18:57
CarltonCarlton
95321638
95321638
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054579%2fretrofit-d-response-expected-begin-array-but-was-begin-object-at-line-1-column%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Delete my answer because it is Rx question I thougth the problem was JSON, try to add the relevant information using the wrapper class mentioned
– cutiko
Mar 8 at 12:07
@cutiko your answer was kinda helpful too. I managed to solve this by changing GET method and my getcities method and add some relevant RxJava methods. Thanks for your help.
– Carlton
Mar 8 at 12:53
Welcomr, post the solution then
– cutiko
Mar 8 at 13:29