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()) {
final JsonArray jsElementArray = element.getAsJsonArray();
value = processJsonArray(jsElementArray, responseCtx);
} else if (element.isJsonNull()) {
// No further processing of null values
value = element;
} else {
value = resolveDependentVariable(element, responseCtx);
}
@@ -820,9 +820,8 @@ public final class BatchHelper {
br.setRelativeUrl(String.format("v1/loans/$.loanId/transactions?command=%s", transactionCommand));
br.setMethod("POST");
String dateString = date.format(DateTimeFormatter.ofPattern("dd MMMM yyyy"));
br.setBody(String.format(
"{\"locale\": \"en\", \"dateFormat\": \"dd MMMM yyyy\", " + "\"transactionDate\": \"%s\", \"transactionAmount\": %s}",
dateString, amount));
br.setBody(String.format("{\"locale\": \"en\", \"dateFormat\": \"dd MMMM yyyy\", "
+ "\"transactionDate\": \"%s\", \"transactionAmount\": %s, \"note\":null}", dateString, amount));
return br;
}