Created by: MarcelTon
Line 55 and 84 were missing the triple-HTLM escape brackets (line 71 had this correctly) leading to code generation such as:
vertx.eventBus().<JsonObject> consumer(LISTACCOUNTS_SERVICE_ID).handler(message -> {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "listAccounts";
String emailAddressParam = message.body().getString("emailAddress");
String emailAddress = (emailAddressParam == null) ? null : emailAddressParam;
JsonArray profileIdParam = message.body().getJsonArray("profileId");
List<String> profileId = (profileIdParam == null) ? new ArrayList<>() : Json.mapper.readValue(profileIdParam.encode(),
Json.mapper.getTypeFactory().constructCollectionType(List.class, String.class));
String schoolIdParam = message.body().getString("schoolId");
String schoolId = (schoolIdParam == null) ? null : schoolIdParam;
service.listAccounts(emailAddress, profileId, schoolId).subscribe(
result -> {
message.reply(new JsonArray(Json.encode(result)).encodePrettily());
},
error -> {
manageError(message, error, "listAccounts");
});
} catch (Exception e) {
logUnexpectedError("listAccounts", e);
message.fail(MainApiException.INTERNAL_SERVER_ERROR.getStatusCode(), MainApiException.INTERNAL_SERVER_ERROR.getStatusMessage());
}
});
Note the ArrayList<>()
notation.