public interface ItemsClient {
@RequestLine("POST /items")
public Map<String, Object> post(Map<String, Object> item);
}
然后
ItemsClient itemsClient = Feign.builder().decoder(new GsonDecoder()).encoder(new GsonEncoder()).target(ItemsClient.class, ROOT_URI);
Map<String, Object> myNewItemWithId = itemsClient.post(myNewItem);
服务器发送带有如下正文的响应:
{
"id" : 108171343002018,
"name" : "myNewItem among many and many !"
}
但是 myNewItemWithId.get("id"); 的值 是 2147483647,Integer 的最大值。
有没有办法告诉 GsonDecoder 将整数解码为 Long ?