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

获取小程序版本列表信息序列化错误 #15

Closed
zerov1219 opened this issue Jul 7, 2021 · 4 comments
Closed

获取小程序版本列表信息序列化错误 #15

zerov1219 opened this issue Jul 7, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@zerov1219
Copy link

com.github.yydzxz.open.api.v1.response.code.CodeVersionsResponse.data.latest.screenshot字段在多张应用截图时接口返回的是List,出现序列化错误。
错误信息如下:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: org.springframework.web.client.RestClientException: Error while extracting response for type [class com.github.yydzxz.open.api.v1.response.code.CodeVersionsResponse] and content type [application/json;charset=utf-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of java.lang.String out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.lang.String out of START_ARRAY token
at [Source: (PushbackInputStream); line: 1, column: 1871] (through reference chain: com.github.yydzxz.open.api.v1.response.code.CodeVersionsResponse["data"]->com.github.yydzxz.open.api.v1.response.code.CodeVersionsResponse$DataObj["latest"]->com.github.yydzxz.open.api.v1.response.code.CodeVersionsResponse$Latest["screenshot"])] with root cause

@yydzxz yydzxz self-assigned this Jul 7, 2021
@yydzxz yydzxz added the bug Something isn't working label Jul 7, 2021
@yydzxz
Copy link
Owner

yydzxz commented Jul 7, 2021

image
字节文档里这是个字符串,不过看你贴的错误,字节实际上可能返回的是个数组, 方便的话, 可以用日志中打印的请求url复制到postman执行一下,把详细的返回数据贴上来.
我发布了一个4.0.3版本,把这个字段从String改为了List<String>, 你可以试试

@zerov1219
Copy link
Author

zerov1219 commented Jul 8, 2021 via email

@zerov1219
Copy link
Author

zerov1219 commented Jul 8, 2021 via email

@yydzxz
Copy link
Owner

yydzxz commented Jul 8, 2021

感谢反馈, 在4.0.5版本已经兼容StringList<String>两种情况, 可以通过parseScreenshot()方法获取screenshot字段的值

@yydzxz yydzxz pinned this issue Jul 9, 2021
@yydzxz yydzxz closed this as completed Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants