FINERACT-1975: BatchAPI - JSON handler cannot handle null (fix)

This commit is contained in:
Adam Saghy
2023-09-15 08:01:01 +02:00
parent f7d41b58b3
commit 8eecb866c8
2 changed files with 5 additions and 3 deletions
@@ -182,6 +182,9 @@ public class ResolutionHelper {
} else if (element.isJsonArray()) { } else if (element.isJsonArray()) {
final JsonArray jsElementArray = element.getAsJsonArray(); final JsonArray jsElementArray = element.getAsJsonArray();
value = processJsonArray(jsElementArray, responseCtx); value = processJsonArray(jsElementArray, responseCtx);
} else if (element.isJsonNull()) {
// No further processing of null values
value = element;
} else { } else {
value = resolveDependentVariable(element, responseCtx); value = resolveDependentVariable(element, responseCtx);
} }
@@ -820,9 +820,8 @@ public final class BatchHelper {
br.setRelativeUrl(String.format("v1/loans/$.loanId/transactions?command=%s", transactionCommand)); br.setRelativeUrl(String.format("v1/loans/$.loanId/transactions?command=%s", transactionCommand));
br.setMethod("POST"); br.setMethod("POST");
String dateString = date.format(DateTimeFormatter.ofPattern("dd MMMM yyyy")); String dateString = date.format(DateTimeFormatter.ofPattern("dd MMMM yyyy"));
br.setBody(String.format( br.setBody(String.format("{\"locale\": \"en\", \"dateFormat\": \"dd MMMM yyyy\", "
"{\"locale\": \"en\", \"dateFormat\": \"dd MMMM yyyy\", " + "\"transactionDate\": \"%s\", \"transactionAmount\": %s}", + "\"transactionDate\": \"%s\", \"transactionAmount\": %s, \"note\":null}", dateString, amount));
dateString, amount));
return br; return br;
} }