Here is my serivce interface:
@POST("/serachtracks")
Call<List<Track>> searchTracks(@Header("Authentification") String accessToken, @Query("tag") String tag);
Here is class Track:
public class Track implements Serializable {
@SerializedName("track_id")
public int id;
@SerializedName("track_title")
public String title;
@SerializedName("track_tags")
public String tags;
// ... GETERS & SERTERS
}
JSON that i receive from server:
[{"track_id":9833,"track_title":"A some title","track_tags":"#tags"}, {...}, {...}]
But i get this error:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
at com.google.gson.Gson.fromJson(Gson.java:873)
at com.google.gson.Gson.fromJson(Gson.java:826)
Please help! Thanks!