fixed deserialization issue caused from json to String
This commit is contained in:
parent
0674a3c031
commit
f88d9b8381
|
@ -287,16 +287,14 @@ public class RepositoryServiceImpl implements RepositoryService {
|
||||||
requestFilter.setEnglishname(englishName);
|
requestFilter.setEnglishname(englishName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String rs = restTemplate.postForObject(uriComponents.toUri(), requestFilter, String.class);
|
Map rs = restTemplate.postForObject(uriComponents.toUri(), requestFilter, Map.class);
|
||||||
if (rs == null) {
|
if (rs == null) {
|
||||||
logger.error("DSM response is null : [url={}]", uriComponents.toUri());
|
logger.error("DSM response is null : [url={}]", uriComponents.toUri());
|
||||||
} else {
|
} else {
|
||||||
JSONObject response = new JSONObject(rs);
|
Header header = mapper.readValue(mapper.writeValueAsString(rs.get("header")), Header.class);
|
||||||
JSONArray jsonArray = (JSONArray) response.get("datasourceInfo");
|
|
||||||
Header header = mapper.readValue(response.get("header").toString(), Header.class);
|
|
||||||
snippets = Paging.of(header,
|
snippets = Paging.of(header,
|
||||||
mapper.readValue(
|
mapper.readValue(
|
||||||
String.valueOf(jsonArray),
|
mapper.writeValueAsString(rs.get("datasourceInfo")),
|
||||||
mapper.getTypeFactory().constructCollectionType(List.class, RepositorySnippet.class)));
|
mapper.getTypeFactory().constructCollectionType(List.class, RepositorySnippet.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue