即使它不是数组,也要序列化对象

时间:2015-04-03 14:50:18

标签: spring resttemplate

我正在使用spring和REST API。目前我正在尝试使用第三方REST API,它具有可以是数组或单个对象的属性。我不知道如何处理RESTTemplate尝试将单个对象映射到数组的情况。我尝试考虑CustomSerializer,但想到询问是否还有其他功能可用于此。

响应可以低于{ searchBusinessUnitsDetailsResponse: { responseMessage: { code: "SUCCESS" description: "SUCCESS" }- businessUnitDetails: { name: "MCDONOUGH, GA" number: "3201"

 {
searchBusinessUnitsDetailsResponse: {
responseMessage: {
code: "SUCCESS"
description: "SUCCESS"
}-
businessUnitDetails: [2]
0:  {
name: "PQR, AR"
number: "XZY"},1:{name:"abc, GA", number:"LMN"}}

此致

0 个答案:

没有答案