调用feign接口,序列化报错

Java 未结 1 1876
M
M 剑童 2019-10-25 14:30

image.png


R(code=500, success=false, data=null, msg=Error while extracting response for type [org.springblade.core.tool.api.R] 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_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token

 at [Source: (PushbackInputStream); line: 1, column: 36] (through reference chain: org.springblade.core.tool.api.R["data"]))


在代码里直接调用feign接口就有,序列化问题,

直接用postman调用则没有问题,我是不是哪里少了

1条回答
  • #blade配置
    blade:
     #jackson配置
     jackson:
       #null自动转空值
       null-to-empty: false

    如上配置即可解决你的问题

    0 讨论(1)
提交回复