yydzxz/ByteDanceOpen

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

zerov1219 opened this issue · 4 comments

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

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

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