I can’t get the JSON data “Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $”

This my Json

"teams": [
        "idTeam": "133604",
        "idSoccerXML": "9",
        "idAPIfootball": "42",
        "intLoved": "4",
        "strTeam": "Arsenal",
        "strTeamShort": "ARS",
        "strAlternate": "Arsenal Football Club",
        "intFormedYear": "1892",
        "strSport": "Soccer",
        "strLeague": "English Premier League",
        "idLeague": "4328",
        "strLeague2": "UEFA Europa League",
        "idLeague2": "4481",
        "strLeague3": "FA Cup",
        "idLeague3": "4482",
        "strLeague4": "EFL Cup",
        "idLeague4": "4570",
        "strLeague5": "FA Community Shield",
        "idLeague5": "4571",
        "strLeague6": "",
        "idLeague6": null,
        "strLeague7": "",
        "idLeague7": null,
        "strDivision": null,
        "strManager": "",
        "strStadium": "Emirates Stadium",
        "strKeywords": "Gunners, Gooners",
        "strRSS": "https://www.allarsenal.com/feed/",
        "strStadiumLocation": "Holloway, London",
        "intStadiumCapacity": "60338",
        "strWebsite": "www.arsenal.com",
        "strFacebook": "www.facebook.com/Arsenal",
        "strTwitter": "twitter.com/arsenal",
        "strInstagram": "instagram.com/arsenal",
        "strDescriptionIL": null,
        "strDescriptionPL": null,
        "strGender": "Male",
        "strCountry": "England",
        "strTeamBadge": "https://www.thesportsdb.com/images/media/team/badge/uyhbfe1612467038.png",
        "strTeamJersey": "https://www.thesportsdb.com/images/media/team/jersey/mpintc1586884343.png",
        "strTeamLogo": "https://www.thesportsdb.com/images/media/team/logo/q2mxlz1512644512.png",
        "strTeamFanart1": "https://www.thesportsdb.com/images/media/team/fanart/xyusxr1419347566.jpg",
        "strTeamFanart2": "https://www.thesportsdb.com/images/media/team/fanart/qttspr1419347612.jpg",
        "strTeamFanart3": "https://www.thesportsdb.com/images/media/team/fanart/uwssqx1420884450.jpg",
        "strTeamFanart4": "https://www.thesportsdb.com/images/media/team/fanart/qtprsw1420884964.jpg",
        "strTeamBanner": "https://www.thesportsdb.com/images/media/team/banner/rtpsrr1419351049.jpg",
        "strYoutube": "www.youtube.com/user/ArsenalTour",
        "strLocked": "unlocked"

This is my ApiService

public interface TeamApiService {

Observable<List<TeamModel.Team>> getTeam();


This is my Repository

 public class Repository {

private TeamApiService apiService;

public Repository(TeamApiService apiService){
    this.apiService = apiService;
public Observable<List<TeamModel.Team>> getTeam(){
    return apiService.getTeam();


This is my “View Model”

public class SoccerViewModel extends ViewModel {

private static final String TAG = "ViewModel";
private MutableLiveData<List<TeamModel.Team>> teamList = new MutableLiveData<>();

private Repository repository;

public SoccerViewModel(Repository repository) {
    this.repository = repository;

public LiveData<List<TeamModel.Team>> getTeamList() {
    return teamList;

public void getTeams() {
            .subscribe(result -> teamList.setValue(result),
                    error -> Log.e(TAG, "getTips: " + error.getMessage()));

This my View

private void observeData() {
    viewModel = new ViewModelProvider(this).get(SoccerViewModel.class);
    viewModel.getTeamList().observe(this, new Observer<List<TeamModel.Team>>() {
        public void onChanged(List<TeamModel.Team> pokemons) {
            Log.e(TAG, "onChanged: " + pokemons.size() );

private void initRecyclerView(List<TeamModel.Team> team) {
   recyclerView = findViewById(R.id.teamRV);
   rv = new LinearLayoutManager(TeamView.this,RecyclerView.HORIZONTAL,false);
   adapter = new TeamAdapte(TeamView.this,team);

This is my Model

public class TeamModel {
private List<Team> teams = null;

public class Team {

    private String idTeam;
    private String idSoccerXML;
    private String idAPIfootball;
    private String intLoved;
    private String strTeam;
    private String strTeamShort;
    private String strAlternate;
    private String intFormedYear;
    private String strSport;
    private String strLeague;
    private String idLeague;
    private String strLeague2;
    private String idLeague2;
    private String strLeague3;
    private String idLeague3;
    private String strLeague4;
    private String idLeague4;
    private String strLeague5;
    private String idLeague5;
    private String strLeague6;
    private Object idLeague6;
    private String strLeague7;
    private Object idLeague7;
    private Object strDivision;
    private String strManager;
    private String strStadium;
    private String strKeywords;
    private String strRSS;
    private String strStadiumThumb;
    private String strStadiumDescription;
    private String strStadiumLocation;
    private String intStadiumCapacity;
    private String strWebsite;
    private String strFacebook;
    private String strTwitter;
    private String strInstagram;
    private String strDescriptionEN;
    private String strDescriptionDE;
    private String strDescriptionFR;
    private Object strDescriptionCN;
    private String strDescriptionIT;
    private String strDescriptionJP;
    private String strDescriptionRU;
    private String strDescriptionES;
    private String strDescriptionPT;
    private Object strDescriptionSE;
    private Object strDescriptionNL;
    private Object strDescriptionHU;
    private String strDescriptionNO;
    private Object strDescriptionIL;
    private Object strDescriptionPL;
    private String strGender;
    private String strCountry;
    private String strTeamBadge;
    private String strTeamJersey;
    private String strTeamLogo;
    private String strTeamFanart1;
    private String strTeamFanart2;
    private String strTeamFanart3;
    private String strTeamFanart4;
    private String strTeamBanner;
    private String strYoutube;
    private String strLocked;

    public Team(String idTeam, String idSoccerXML, String idAPIfootball, String intLoved, String strTeam, String strTeamShort, String strAlternate, String intFormedYear, String strSport, String strLeague, String idLeague, String strLeague2, String idLeague2, String strLeague3, String idLeague3, String strLeague4, String idLeague4, String strLeague5, String idLeague5, String strLeague6, Object idLeague6, String strLeague7, Object idLeague7, Object strDivision, String strManager, String strStadium, String strKeywords, String strRSS, String strStadiumThumb, String strStadiumDescription, String strStadiumLocation, String intStadiumCapacity, String strWebsite, String strFacebook, String strTwitter, String strInstagram, String strDescriptionEN, String strDescriptionDE, String strDescriptionFR, Object strDescriptionCN, String strDescriptionIT, String strDescriptionJP, String strDescriptionRU, String strDescriptionES, String strDescriptionPT, Object strDescriptionSE, Object strDescriptionNL, Object strDescriptionHU, String strDescriptionNO, Object strDescriptionIL, Object strDescriptionPL, String strGender, String strCountry, String strTeamBadge, String strTeamJersey, String strTeamLogo, String strTeamFanart1, String strTeamFanart2, String strTeamFanart3, String strTeamFanart4, String strTeamBanner, String strYoutube, String strLocked) {
        this.idTeam = idTeam;
        this.idSoccerXML = idSoccerXML;
        this.idAPIfootball = idAPIfootball;
        this.intLoved = intLoved;
        this.strTeam = strTeam;
        this.strTeamShort = strTeamShort;
        this.strAlternate = strAlternate;
        this.intFormedYear = intFormedYear;
        this.strSport = strSport;
        this.strLeague = strLeague;
        this.idLeague = idLeague;
        this.strLeague2 = strLeague2;
        this.idLeague2 = idLeague2;
        this.strLeague3 = strLeague3;
        this.idLeague3 = idLeague3;
        this.strLeague4 = strLeague4;
        this.idLeague4 = idLeague4;
        this.strLeague5 = strLeague5;
        this.idLeague5 = idLeague5;
        this.strLeague6 = strLeague6;
        this.idLeague6 = idLeague6;
        this.strLeague7 = strLeague7;
        this.idLeague7 = idLeague7;
        this.strDivision = strDivision;
        this.strManager = strManager;
        this.strStadium = strStadium;
        this.strKeywords = strKeywords;
        this.strRSS = strRSS;
        this.strStadiumThumb = strStadiumThumb;
        this.strStadiumDescription = strStadiumDescription;
        this.strStadiumLocation = strStadiumLocation;
        this.intStadiumCapacity = intStadiumCapacity;
        this.strWebsite = strWebsite;
        this.strFacebook = strFacebook;
        this.strTwitter = strTwitter;
        this.strInstagram = strInstagram;
        this.strDescriptionEN = strDescriptionEN;
        this.strDescriptionDE = strDescriptionDE;
        this.strDescriptionFR = strDescriptionFR;
        this.strDescriptionCN = strDescriptionCN;
        this.strDescriptionIT = strDescriptionIT;
        this.strDescriptionJP = strDescriptionJP;
        this.strDescriptionRU = strDescriptionRU;
        this.strDescriptionES = strDescriptionES;
        this.strDescriptionPT = strDescriptionPT;
        this.strDescriptionSE = strDescriptionSE;
        this.strDescriptionNL = strDescriptionNL;
        this.strDescriptionHU = strDescriptionHU;
        this.strDescriptionNO = strDescriptionNO;
        this.strDescriptionIL = strDescriptionIL;
        this.strDescriptionPL = strDescriptionPL;
        this.strGender = strGender;
        this.strCountry = strCountry;
        this.strTeamBadge = strTeamBadge;
        this.strTeamJersey = strTeamJersey;
        this.strTeamLogo = strTeamLogo;
        this.strTeamFanart1 = strTeamFanart1;
        this.strTeamFanart2 = strTeamFanart2;
        this.strTeamFanart3 = strTeamFanart3;
        this.strTeamFanart4 = strTeamFanart4;
        this.strTeamBanner = strTeamBanner;
        this.strYoutube = strYoutube;
        this.strLocked = strLocked;

    public String getIdTeam() {
        return idTeam;

    public String getIdSoccerXML() {
        return idSoccerXML;

    public String getIdAPIfootball() {
        return idAPIfootball;

    public String getIntLoved() {
        return intLoved;

    public String getStrTeam() {
        return strTeam;

    public String getStrTeamShort() {
        return strTeamShort;

    public String getStrAlternate() {
        return strAlternate;

    public String getIntFormedYear() {
        return intFormedYear;

    public String getStrSport() {
        return strSport;

    public String getStrLeague() {
        return strLeague;

    public String getIdLeague() {
        return idLeague;

    public String getStrLeague2() {
        return strLeague2;

    public String getIdLeague2() {
        return idLeague2;

    public String getStrLeague3() {
        return strLeague3;

    public String getIdLeague3() {
        return idLeague3;

    public String getStrLeague4() {
        return strLeague4;

    public String getIdLeague4() {
        return idLeague4;

    public String getStrLeague5() {
        return strLeague5;

    public String getIdLeague5() {
        return idLeague5;

    public String getStrLeague6() {
        return strLeague6;

    public Object getIdLeague6() {
        return idLeague6;

    public String getStrLeague7() {
        return strLeague7;

    public Object getIdLeague7() {
        return idLeague7;

    public Object getStrDivision() {
        return strDivision;

    public String getStrManager() {
        return strManager;

    public String getStrStadium() {
        return strStadium;

    public String getStrKeywords() {
        return strKeywords;

    public String getStrRSS() {
        return strRSS;

    public String getStrStadiumThumb() {
        return strStadiumThumb;

    public String getStrStadiumDescription() {
        return strStadiumDescription;

    public String getStrStadiumLocation() {
        return strStadiumLocation;

    public String getIntStadiumCapacity() {
        return intStadiumCapacity;

    public String getStrWebsite() {
        return strWebsite;

    public String getStrFacebook() {
        return strFacebook;

    public String getStrTwitter() {
        return strTwitter;

    public String getStrInstagram() {
        return strInstagram;

    public String getStrDescriptionEN() {
        return strDescriptionEN;

    public String getStrDescriptionDE() {
        return strDescriptionDE;

    public String getStrDescriptionFR() {
        return strDescriptionFR;

    public Object getStrDescriptionCN() {
        return strDescriptionCN;

    public String getStrDescriptionIT() {
        return strDescriptionIT;

    public String getStrDescriptionJP() {
        return strDescriptionJP;

    public String getStrDescriptionRU() {
        return strDescriptionRU;

    public String getStrDescriptionES() {
        return strDescriptionES;

    public String getStrDescriptionPT() {
        return strDescriptionPT;

    public Object getStrDescriptionSE() {
        return strDescriptionSE;

    public Object getStrDescriptionNL() {
        return strDescriptionNL;

    public Object getStrDescriptionHU() {
        return strDescriptionHU;

    public String getStrDescriptionNO() {
        return strDescriptionNO;

    public Object getStrDescriptionIL() {
        return strDescriptionIL;

    public Object getStrDescriptionPL() {
        return strDescriptionPL;

    public String getStrGender() {
        return strGender;

    public String getStrCountry() {
        return strCountry;

    public String getStrTeamBadge() {
        return strTeamBadge;

    public String getStrTeamJersey() {
        return strTeamJersey;

    public String getStrTeamLogo() {
        return strTeamLogo;

    public String getStrTeamFanart1() {
        return strTeamFanart1;

    public String getStrTeamFanart2() {
        return strTeamFanart2;

    public String getStrTeamFanart3() {
        return strTeamFanart3;

    public String getStrTeamFanart4() {
        return strTeamFanart4;

    public String getStrTeamBanner() {
        return strTeamBanner;

    public String getStrYoutube() {
        return strYoutube;

    public String getStrLocked() {
        return strLocked;

public TeamModel(List<Team> teams) {
    this.teams = teams;

I use https://www.jsonschema2pojo.org/ to construct my Model. I still have this issue Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $. I’m using retrofit and rxjava in this project and Observable for call. can you enlighten me on this problem.


it tell you your json start with object but your model start with array , see this question and note of that , it help you

change your code as below this :

public class temsData{

  private String idTeam;
  private String idSoccerXML;
  private String idAPIfootball;

       public String getidTeam() {
            return idTeam;

    public String getidSoccerXML() {
            return idSoccerXML;

    public String getidAPIfootball() {
            return idAPIfootball;

// and add your more data like this ...


then made another class like this :

public class TeamList {

        private List<temsData> teams;
        public List<temsData> getTems() {
            return teams;


then use TeamList class in your retrofit body to get your data