Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gson转换总是报错误 #1

Open
shenzhen-arrom opened this issue Apr 12, 2017 · 3 comments
Open

gson转换总是报错误 #1

shenzhen-arrom opened this issue Apr 12, 2017 · 3 comments

Comments

@shenzhen-arrom
Copy link

这两句code会报错
Type baseResuteType= $Gson$Types.newParameterizedTypeWithOwner(null, BaseResult.class,type);
BaseResult baseResult=gson.fromJson(response,baseResuteType);
场景:results里面是包含的是一个数组
错误:Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 10 path $.data

@mcxtzhang
Copy link
Owner

试试用List 会不会报错。我在项目中接受 Bean 和List 都是可以的呀

@shenzhen-arrom
Copy link
Author

@get("api/data/{category}/{size}/{page}")
Observable<BaseBean<List>> getDataByWrapper(@path("category") String a,
@path("size") String b,
@path("page") String c); 去掉那个baseBean就可以了???

@mcxtzhang
Copy link
Owner

Observable<List<YourJavaBean>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants