feign can't deserialize ResponseEntity
interface ServiceClient{
BaseResult<AddressDto> getAddress(int addressId);
}
response: {"Result":true,"Message":null,"Data":{"UserId":1,"AddressId":2,"ProvinceId":10000,"CityId":11000,"CountyId":0,"IsDefault":0,"Address":"xxx","AddressDetail":"xxxxx"},"Version":0,"ErrorCode":0}
deserialize result: BaseResult(Result=false, Message=null, Data=null, Version=0, ErrorCode=0)
Class defination
public class BaseResult<T> implements Serializable {
private boolean Result;
private String Message;
private T Data;
private int Version;
private int ErrorCode;
//getter;setter
}
public class AddressDto implements Serializable {
private int UserId ;
private int AddressId ;
private long ProvinceId ;
private long CityId ;
private long CountyId ;
private int IsDefault ;
private String Address ;
private String AddressDetail ;
//getter;setter
}
Comment From: marcingrzejszczak
Please learn how to properly format the code
Comment From: marcingrzejszczak
Also please read the template of an issue you've deleted when you've filed this issue and add the missing information
<!--
Thanks for raising a Spring Cloud issue. What sort of issue are you raising?
Question
Please ask questions about how to use something, or to understand why something isn't
working as you expect it to, on Stack Overflow using the spring-cloud tag.
Bug report
Please provide details of the problem, including the version of Spring Cloud that you
are using. If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.
Enhancement
Please start by describing the problem that you are trying to solve. There may already
be a solution, or there may be a way to solve it that you hadn't considered.
-->
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.