Closed sashkoif closed 5 years ago
This is full method
public static List<LoanAgreement> getLoanAgreements() {
List<LoanAgreement> loanAgreements = new ArrayList<LoanAgreement>();
String accessToken = TokenService.getAccessToken();
String jsonResult = "";
try {
jsonResult = ConnectorService.getGETResponse(accessToken, "loanagreements");
JavaTimeModule module = new JavaTimeModule();
module.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")));
module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")));
ObjectMapper mapper = new ObjectMapper().registerModule(module);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
loanAgreements = mapper.readValue(jsonResult, new TypeReference<List<LoanAgreement>>(){});
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return loanAgreements;
}
I try to use edited JSON result. I removed all elements from cashCollaterals array. I know it's incorrect but it works.
Please try with the latest model version
it works!
When open http://localhost:10002 I get empty list of loan agreements on view element. In cosole I get
I receive it when should be executed this
loanAgreements = mapper.readValue(jsonResult, new TypeReference<List<LoanAgreement>>(){});
On previous vesions of core-model and server all was fine. Do you have any suggestions what could it be or how can it be solved?