retrofit.converter.ConversionException com.google.gson.JsonSyntaxException:java.lang.IllegalStateException:期望的BEGIN_OBJECT

时间:2014-06-12 08:16:35

标签: java android json jackson retrofit

我尝试解析一个json,这是我的Json解析:

        [{"id":"avengers","name":"Avengers","description":"Captain America, Iron Man, Wasp, Thor, Hulk et Ant-Man sont r\u00e9unis pour vivre ensemble de nouvelles aventures contre des extra-terrestres et des robots \u00e0 la fois dangereux et \u00e9tranges. Cette formidable \u00e9quipe de super-h\u00e9ros devra prot\u00e9ger la Terre du danger que repr\u00e9sentent tous ces ennemis et ils devront pour cela associer leurs diff\u00e9rents pouvoirs.","rank":"emblematic","category":"action","idSIVideos":["avengers"],"idPlurimedias":[],"avatar":{"id":"avengers","alternativeText":"Avengers Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/avengers.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/avengers.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/avengers.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/avengers.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/avengers.jpg"}},"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[{"id":"badge-4","title":"badge 4"},{"id":"badge-5","title":"badge 5"}],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"c-est-bon","name":"C'est bon !","description":"D\u00e9couvre la cuisine avec un Jean-Pierre Koffe tr\u00e8s anim\u00e9.","rank":"emblematic","category":"comedie","idSIVideos":["c_est_bon"],"idPlurimedias":[],"avatar":{"id":"c-est-bon","alternativeText":"C'est bon Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/c-est-bon.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/c-est-bon.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/c-est-bon.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/c-est-bon.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/c-est-bon.jpg"}},"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[{"id":"badge-5-1","title":"badge 5"}],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"captain-biceps","name":"Captain Biceps","description":"Captain Biceps, c\u2019est le plus fort ! Captain Biceps, il a les plus gros biscotos de l\u2019univers ! Captain Biceps, c\u2019est un Super H\u00e9ros ! Il ne craint rien ni personne, enfin\u2026 \u00e0 part sa Maman ! Quoi\u2026 il ne vous a pas dit ?!","rank":"emblematic","category":"bridge","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"chaplin","name":"Chaplin","description":"Sous le regard de Chaplin, chaque petit \u00e9v\u00e9nement du quotidien se transforme en une formidable com\u00e9die.","rank":"emblematic","category":"comedie","idSIVideos":["chaplin_co"],"idPlurimedias":[],"avatar":{"id":"chaplin","alternativeText":"Chaplin Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/chaplin.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/chaplin.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/chaplin.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/chaplin.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/chaplin.jpg"}},"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"code-lyoko","name":"Code Lyoko","description":"Un monde virtuel existe en parall\u00e8le au n\u00f4tre: Lyoko. Le super-ordinateur infect\u00e9 par un virus d\u00e9nomm\u00e9 X.A.N.A., r\u00e9gente l\u2019existence digitale de ce monde et menace gravement Lyoko et la Terre. Sur Lyoko, Aelita est la seule cr\u00e9ature humano\u00efde virtuelle qui r\u00e9siste \u00e0 X.A.N.A. Mais elle est soutenue par quatre adolescents qui ont d\u00e9couvert l\u2019existence de X.A.N.A. Depuis, Yumi, Odd, Ulrich et Jeremy m\u00e8nent une double vie: coll\u00e9giens ordinaires pendant les heures de cours, ils passent le reste de leur temps \u00e0 aider Aelita \u00e0 sauver le monde!","rank":"emblematic","category":"action","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"code-lyoko-evolution","name":"Code Lyoko Evolution","description":"J\u00e9r\u00e9mie, Aelita, Yumi, Ulrich, et Odd retournent \u00e0 leur vie quotidienne d'\u00e9l\u00e8ves du Coll\u00e8ge Kadic. Mais XANA, le programme multi-agents qui \u00e9tait devenu leur ennemi mortel et qu'ils \u00e9taient parvenus \u00e0 d\u00e9truire dans leurs pr\u00e9c\u00e9dentes aventures, r\u00e9appara\u00eet. Les Lyoko Guerriers r\u00e9activent le supercalculateur afin de retourner sur Lyoko, d\u00e9couvrir les raisons de cette r\u00e9apparition, et y mettre un terme avant que la Terre ne soit de nouveau menac\u00e9e.","rank":"emblematic","category":"action","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"commandant-clark","name":"Commandant Clark","description":"Au fin fond de l'espace, une \u00e9quipe d'animaux essaye de r\u00e9pandre la paix dans l'univers \u00e0 bord de leur vaisseau se nommant \u00ab l'Arche \u00bb, pilot\u00e9 par le tr\u00e8s grand Commandant Clark, un chien des plus courageux luttant sans cesse contre la menace des Animatronix, dangereux robots en forme d'animaux.","rank":"emblematic","category":"bridge","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"dofus","name":"Dofus","description":"L\u2019\u00e9choppe de Kerubim Cr\u00e9pin est une v\u00e9ritable caverne aux tr\u00e9sors ! \u00c0 la lueur d\u2019une lampe \u00e0 huile, on peut y d\u00e9nicher des antiquit\u00e9s en tous genres : armes, amulettes, talismans, ou encore objets d\u00e9coratifs, pr\u00e9cieux, et m\u00eame magiques\u2026 Chacun d\u2019eux a son histoire, et chaque histoire son \u00e9pisode ! C\u2019est l\u2019occasion pour le vieil Ecaflip de raconter ses souvenirs, ses rencontres et ses extraordinaires aventures \u00e0 son fils adoptif, Joris.","rank":"emblematic","category":"action","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"dragons-cavaliers-de-beurk","name":"Dragons, cavaliers de Beurk","description":"Harold, un adolescent intelligent et solitaire, est le premier viking \u00e0 avoir apprivois\u00e9 un dragon. Son objectif est de pr\u00e9server la fragile alliance entre les vikings et les dragons. Dans sa qu\u00eate, il est accompagn\u00e9 d'autres vikings adolescents dont Astrid, Sto\u00efc, Gueulefor, Rustik, Varek, et Kognedur et Kranedur.","rank":"emblematic","category":"action","idSIVideos":[],"idPlurimedias":[],"avatar":{"id":"dragons-cavaliers-de-beurk","alternativeText":"Dragons, cavaliers de Beurk Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/dragons-cavaliers-de-beurk.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/dragons-cavaliers-de-beurk.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/dragons-cavaliers-de-beurk.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/dragons-cavaliers-de-beurk.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/dragons-cavaliers-de-beurk.jpg"}},"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"en-sortant-de-l-ecole","name":"En Sortant de l'\u00e9cole","description":"Harold, un adolescent intelligent et solitaire, est le premier viking \u00e0 avoir apprivois\u00e9 un dragon. Son objectif est de pr\u00e9server la fragile alliance entre les vikings et les dragons. Dans sa qu\u00eate, il est accompagn\u00e9 d'autres vikings adolescents dont Astrid, Sto\u00efc, Gueulefor, Rustik, Varek, et Kognedur et Kranedur.","rank":"emblematic","idSIVideos":["en_sortant_de_l_ecole"],"idPlurimedias":[],"avatar":{"id":"en-sortant-de-l-ecole","alternativeText":"En sortant de l'\u00e9cole Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/en-sortant-de-l-ecole.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/en-sortant-de-l-ecole.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/en-sortant-de-l-ecole.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/en-sortant-de-l-ecole.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/en-sortant-de-l-ecole.jpg"}},"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"famille-delajungle","name":"Famille Delajungle","description":"La Famille Delajungle est une famille de globe-trotters parcourant le monde dans un camping-car pr\u00e9par\u00e9 pour l'aventure. On retrouve donc les deux parents, Nigel et Marianne, qui sont des documentaristes passionn\u00e9s, leurs deux filles, Donnie l'enfant sauvage adopt\u00e9 ainsi qu'un chimpanz\u00e9. Eliza Delajungle, la plus petite des deux filles de la famille, a le don particulier de parler aux animaux. Un don qui lui a \u00e9t\u00e9 transmis en Afrique et dont elle ne doit pas r\u00e9v\u00e9ler l'existence sous peine de le voir dispara\u00eetre.","rank":"emblematic","category":"comedie","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"foot2rue","name":"Foot2rue","description":"C\u2019est un bel \u00e9t\u00e9 qui s\u2019annonce : les Bleus sont tous pass\u00e9s dans la classe sup\u00e9rieure et sont qualifi\u00e9s pour la prochaine \u00e9dition de la Coupe du Monde de foot de rue.","rank":"emblematic","category":"action","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"foot2rue-extreme","name":"Foot2rue Extr\u00eame","description":"Afin d\u2019\u00e9lire l\u2019\u00e9quipe de la m\u00e9tropole qui participera \u00e0 la Coupe du Monde de Foot Extr\u00eame, cinq \u00e9quipes de jeunes filles et gar\u00e7ons se d\u00e9fient chaque week-end dans un tournoi m\u00ealant diff\u00e9rents sports urbains. Les matchs ont lieu dans un centre commercial en construction. Le but d\u2019un match est toujours le m\u00eame : repousser les limites, viser la victoire mais surtout s\u2019amuser, \u00e0 la fois pour les joueurs et le public. Nos h\u00e9ros vont b\u00e9n\u00e9ficier du soutien de Tag, un ancien champion du Foot de Rue qui agira comme un grand-fr\u00e8re et un coach afin de les mener \u00e0 la victoire. Les probl\u00e8mes personnels de chacun seront r\u00e9solus en \u00e9quipe, et avec le ballon au pied.","rank":"gold","category":"action","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"garfield-et-cie","name":"Garfield et Cie","description":"Garfield, c'est un chat paresseux, gourmand qui d\u00e9teste les lundis, qui adore manger, qui aime \u00e9nerver son propri\u00e9taire, Jon et lancer le chien Odie dans les airs. Il ne pense qu'\u00e0 lui mais sait parfois \u00e9couter un peu les autres. GARFIELD est impr\u00e9visible et aime avant tout se faire plaisir. Et pour \u00e7a il est capable de tout...mais pas toujours avec succ\u00e8s.","rank":"emblematic","category":"comedie","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":true,"dateStart":"2014-05-30T17:55:22+0200","dateEnd":"2014-07-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"gigi","name":"Gigi","description":"Gigi une petite princesse vivant dans un pays situ\u00e9 juste au dessus de la Terre est envoy\u00e9e sur Terre par ses parents pour aider un jeune couple sans enfant. Elle devient leur fille. Avec ses fid\u00e8les amis animaux qu'elle a emmen\u00e9 avec elle, elle va aider tous les \u00eatres en difficult\u00e9.","rank":"emblematic","category":"bridge","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":false,"dateStart":"2014-06-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"il-etait-une-fois-l-homme","name":"Il \u00e9tait une fois l'homme","description":"Il \u00e9tait une fois\u2026 l'Homme raconte l'histoire de l'humanit\u00e9, des origines de la vie jusqu'\u00e0 la fin du xxe si\u00e8cle","rank":"emblematic","category":"bridge","idSIVideos":["il_etait_une_fois_l_homme"],"idPlurimedias":[],"avatar":{"id":"il-etait-une-fois-l-homme","alternativeText":"Il \u00e9tait une fois l'homme Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/il-etait-une-fois-l-homme.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/il-etait-une-fois-l-homme.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/il-etait-une-fois-l-homme.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/il-etait-une-fois-l-homme.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/il-etait-une-fois-l-homme.jpg"}},"nbVideos":8,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":false,"dateStart":"2014-06-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:45+0200"},{"id":"jamie-a-des-tentacules","name":"Jamie a des tentacules","description":"Jamie, le fils du roi de la plan\u00e8te Blurb, trouve refuge sur Terre pour \u00e9chapper aux Blarbs lanc\u00e9s \u00e0 ses trousses. La famille Walsh recueille le gar\u00e7on, qui a toutes les difficult\u00e9s du monde \u00e0 dissimuler ses pouvoirs...","rank":"emblematic","category":"comedie","idSIVideos":["jamie_a_des_tentacules_f4"],"idPlurimedias":[],"avatar":{"id":"jamie-a-des-tentacules","alternativeText":"Jamie a des tentacules Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/jamie-a-des-tentacules.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/jamie-a-des-tentacules.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/jamie-a-des-tentacules.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/jamie-a-des-tentacules.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/jamie-a-des-tentacules.jpg"}},"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":false,"dateStart":"2014-06-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"jimmy-neutron","name":"Jimmy Neutron","description":"James \u00ab Jimmy \u00bb Isaac Neutron est un jeune gar\u00e7on surdou\u00e9 vivant dans la ville de R\u00e9troville.Il est \u00e9galement un grand inventeur, cependant ses cr\u00e9ations g\u00e9niales lui causent souvent des ennuis.","rank":"emblematic","category":"comedie","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":false,"dateStart":"2014-06-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"la-chouette-cie","name":"La chouette & Cie","description":"Quand on a le caract\u00e8re ronchon et soupe-au-lait de la chouette, quand on d\u00e9teste le bruit, le d\u00e9sordre, et les autres de mani\u00e8re g\u00e9n\u00e9rale, il n'y a rien de pire que de devoir supporter ses voisins. Et les siens sont gratin\u00e9s.","rank":"emblematic","category":"comedie","idSIVideos":["la_chouette"],"idPlurimedias":[],"avatar":{"id":"la-chouette-cie","alternativeText":"La chouette & Cie Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/la-chouette-cie.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/la-chouette-cie.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/la-chouette-cie.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/la-chouette-cie.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/la-chouette-cie.jpg"}},"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":false,"dateStart":"2014-06-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"la-panthere-rose","name":"La panth\u00e8re rose","description":"Plus jeune, plus moderne et plus inventive que jamais, mais toujours aussi cool, la Panth\u00e8re rose vit de nouvelles aventures.","rank":"emblematic","category":"bridge","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":false,"dateStart":"2014-06-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"la-terre-vue-d-alban","name":"La Terre vue d'Alban","description":"Alban, un petit poisson malicieux qui flotte dans l'espace, visite la Terre. A partir des photos de Yann Arthus-Bertrand de la s\u00e9rie \u00abLa Terre vue du ciel\u00bb, il d\u00e9couvre les richesses naturelles et animales, mais aussi l'univers de l'homme et ses interactions avec la nature.","rank":"emblematic","category":"comedie","idSIVideos":["la_terre_vue_d_alban"],"idPlurimedias":[],"avatar":{"id":"la-terre-vue-d-alban","alternativeText":"La Terre vue d'Alban Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/la-terre-vue-d-alban.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/la-terre-vue-d-alban.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/la-terre-vue-d-alban.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/la-terre-vue-d-alban.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/la-terre-vue-d-alban.jpg"}},"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"publication":{"status":false,"dateStart":"2014-06-11T17:55:22+0200"},"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"le-monde-de-pahe","name":"Le monde de Pah\u00e9","description":"Pah\u00e9 est gabonais. De sa naissance \u00e0 Bitam dans une famille tr\u00e8s nombreuse \u00e0 son arriv\u00e9e en France, voici les aventures de Pah\u00e9 inspir\u00e9es par la BD autobiographique \"La vie de Pah\u00e9\". Entre autod\u00e9rision et petites gal\u00e8res, le monde de Pah\u00e9 est touchant et joyeux..","rank":"emblematic","category":"comedie","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"les-4-fantastiques","name":"Les 4 Fantastiques","description":"Au cours d'un vol spatial, quatre amis subissent des radiations cosmiques qui transforment leur structure mol\u00e9culaire et les dotent de super pouvoirs. De retour sur Terre, ils mettent leurs dons au service de l'humanit\u00e9.","rank":"emblematic","category":"action","idSIVideos":["4_fantastiques"],"idPlurimedias":[],"avatar":{"id":"les-4-fantastiques","alternativeText":"Les 4 fantastiques Alt","created":"2014-06-11T17:55:21+0200","uri":{"gallery":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/gallery\/les-4-fantastiques.jpg","vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/vignette\/les-4-fantastiques.jpg","tiny_vignette":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/tiny_vignette\/les-4-fantastiques.jpg","player_small":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/player_small\/les-4-fantastiques.jpg","raw":"http:\/\/develop.api.jeunesse.build.indus.ftven.net\/app.php\/api\/images\/raw\/les-4-fantastiques.jpg"}},"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"badges":[],"created":"2014-06-11T17:55:22+0200","updated":"2014-06-11T17:55:22+0200"},{"id":"les-as-de-la-jungle","name":"Les As de la Jungle","description":"Il y a Maurice, le pingouin qui se prend pour un tigre, Fred, le phacoch\u00e8re crooner, ou Gilbert, le tarsier parano\u00efaque... \u00c0 travers des reportages et des interviews, d\u00e9couvre le quotidien d'une bande d'animaux loufoques et \u00e9tonnants !","rank":"emblematic","category":"comedie","idSIVideos":[],"idPlurimedias":[],"nbVideos":0,"nbGames":0,"nbFollowers":0,"userAvatars":[],"badges":[],"created":"2014-06-1....

为此,我使用改造(客户强加此)

我尝试这样的事情:

     public List<HeroeDto>retrieveHeroes(){
    String paramOfBaseUrl  = "heroes";  
    RestAdapter restAdapter = getRestAdapter();
    HeroesInterface heroesInterface = restAdapter.create(HeroesInterface.class);
    List<HeroeDto>  listHeroes = heroesInterface.retrieveHeroes(paramOfBaseUrl);
    return listHeroes;
}


    private Gson getConverter() {
    Gson gson = new GsonBuilder()
    .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
    .registerTypeAdapter(Date.class, new DateTypeAdapter())
    .create();
    return gson;
}


  interface HeroesInterface {
    @GET("/{param}")
    List<HeroeDto> retrieveHeroes(
        @Path("param") String heroes
    );
  }

heroesDto.java:

    @JsonIgnoreProperties(ignoreUnknown = true)
    public class HeroeDto {


@JsonProperty(value = "id")
private String id;
   @JsonProperty(value = "name")
    private String name;
    @JsonProperty(value = "colorActu")
    private String colorActu;
    @JsonProperty(value = "description")
    private String description;
    @JsonProperty(value = "category")
    private String category; 
    @JsonProperty(value = "rank")
    private String rank;
    @JsonProperty(value = "nbVideos")
    private String nbVideos;
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColorActu() {
        return colorActu;
    }

    public void setColorActu(String colorActu) {
        this.colorActu = colorActu;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getRank() {
        return rank;
    }

    public void setRank(String rank) {
        this.rank = rank;
    }

    public String getNbVideos() {
        return nbVideos;
    }

    public void setNbVideos(String nbVideos) {
        this.nbVideos = nbVideos;
    }

    public String getNbVideosPublish() {
        return nbVideosPublish;
    }

    public void setNbVideosPublish(String nbVideosPublish) {
        this.nbVideosPublish = nbVideosPublish;
    }

    public String getNbGames() {
        return nbGames;
    }

    public void setNbGames(String nbGames) {
        this.nbGames = nbGames;
    }

    public String getNbFollowers() {
        return nbFollowers;
    }

    public void setNbFollowers(String nbFollowers) {
        this.nbFollowers = nbFollowers;
    }

    public String getCreated() {
        return created;
    }

    public void setCreated(String created) {
        this.created = created;
    }

    public String getUpdated() {
        return updated;
    }

    public void setUpdated(String updated) {
        this.updated = updated;
    }

    public BadgesDto getBadges() {
        return badges;
    }

    public void setBadges(BadgesDto badges) {
        this.badges = badges;
    }

    public AvatarDto getAvatarDto() {
        return avatarDto;
    }

    public void setAvatarDto(AvatarDto avatarDto) {
        this.avatarDto = avatarDto;
    }

    @JsonProperty(value = "nbVideosPublish")
    private String nbVideosPublish;
    @JsonProperty(value = "nbGames")
    private String nbGames;
    @JsonProperty(value = "nbFollowers")
    private String nbFollowers;
    @JsonProperty(value = "created")
    private String created;
    @JsonProperty(value = "updated")
    private String updated;
    @JsonProperty(value = "badges")
    private BadgesDto badges;
    @JsonProperty(value = "avatar")
    private AvatarDto avatarDto;

public String getId() {
    return id;
}

public void setId(String id) {
    this.id = id;
}

}

但是当我启动程序时,我收到此错误:retrofit.RetrofitError:retrofit.converter.ConversionException com.google.gson.JsonSyntaxException:java.lang.IllegalStateException:Expected BEGIN_OBJECT

我该如何解决这个问题?谢谢你的帮助

1 个答案:

答案 0 :(得分:0)

我终于解决了这个问题:

     public List<HeroeDto>retrieveHeroes(){
    String paramOfBaseUrl  = "heroes";  
    RestAdapter restAdapter = getRestAdapter();
    HeroeDto[] listHeroesToReturn = null;
    final Interface client = restAdapter.create(Interface.class);
    Response resp = client.retrieveHeroes(paramOfBaseUrl);

        try {
            String StringJsonHeroes = UtilitiesString.convertStreamToString(resp.getBody().in());
            ObjectMapper mapper = new ObjectMapper();
            listHeroesToReturn =  mapper.readValue(StringJsonHeroes, HeroeDto[].class); 
            UtilitiesString.showLogSuccesRetrieveFromWS(TAG, "HEROES");
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        if(listHeroesToReturn==null)
            UtilitiesString.showLogEchecRetrieveFromWS(TAG, "HEROES");

    return Arrays.asList(listHeroesToReturn);
}



  interface Interface {
    @GET("/{param}")
     Response retrieveHeroes(
        @Path("param") String heroes
    );
  }


      public static String convertStreamToString(InputStream is) throws Exception {
     BufferedReader reader = new BufferedReader(new InputStreamReader(is));
    StringBuilder sb = new StringBuilder();
    String line = null;

    while ((line = reader.readLine()) != null) {
        sb.append(line);
    }

    is.close();

    return sb.toString();
}

public static void showLogSuccesRetrieveFromWS(String TAG, String nameOfWSRetrieven){       
   Log.i(TAG, "la récupération de la WS "+nameOfWSRetrieven+" Reussis");  
}
public static void showLogEchecRetrieveFromWS(String TAG, String nameOfWSRetrieven){       
    Log.i(TAG, "la récupération de la WS "+nameOfWSRetrieven+" a ECHOUE");  
 }

public static void showLogSuccesInsertInDBB(String TAG, String nameOfWSRetrieven){       
    Log.i(TAG, "l insertion des "+nameOfWSRetrieven+" Reussis");  
 }
 public static void showLogEchecInsertInDBB(String TAG, String nameOfWSRetrieven){       
     Log.i(TAG, "l insertion des "+nameOfWSRetrieven+" a ECHOUE");  
  }

感谢您的回复