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

大佬 GsonConverter ,嵌套的json怎么解析 #168

Closed
bbllgo opened this issue Apr 4, 2023 · 3 comments
Closed

大佬 GsonConverter ,嵌套的json怎么解析 #168

bbllgo opened this issue Apr 4, 2023 · 3 comments
Labels
寻求帮助 Extra attention is needed

Comments

@bbllgo
Copy link

bbllgo commented Apr 4, 2023

问题描述

url: https://wanandroid.com/article/list/0/json
Get<ApiPagerResponse<List>>(Api.article + "$i1/json"){
converter= GsonConverter()
}.await()
解析时把 List 檫除了,没有解析,导致返回了null

期望行为

能解析出 List

如何复现

https://wanandroid.com/article/list/0/json

fork仓库并复现问题可以快速解决, 猜测只会让问题晦涩难懂, 耽误所有人时间

截图

异常堆栈信息或者手机截图/视频(拖拽到输入框即可上传)

版本

  • Net: 3.5.7
  • OkHttp: 4.10.0
  • Android:
  • Gradle: 7.5
  • Android Studio:11.0.13
@bbllgo bbllgo added the 寻求帮助 Extra attention is needed label Apr 4, 2023
@liangjingkanji
Copy link
Owner

解析不匹配也不可能返回null

@liangjingkanji
Copy link
Owner

liangjingkanji commented Apr 5, 2023

  1. 我不知道转换器怎么写的, 我也不知道ApiPagerResponse怎么写的, 对于这种问题复现要求fork仓库复现问题, 如果无法复现问题我无法解决, 这是为了保证高质量bug修复所要求的, 因为在过去几年光提别人复现问题猜测问题花费的时间比框架本身时间还要多

  2. 虽然我不推荐这种愚蠢的泛型方式写数据结构, 但是有人这么做也是没问题的 关于版本升级后json数据解析的问题 #165. 在文档中我强调过几次返回什么数据就写什么数据, 直接插件复制粘贴即可生成, 不需要写一堆自作聪明的泛型

@bbllgo
Copy link
Author

bbllgo commented Apr 5, 2023

image
哦 ,就是不支持, 嵌套的方式解析

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
寻求帮助 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants