Skip to content

Commit

Permalink
Updating objectMapper usage
Browse files Browse the repository at this point in the history
  • Loading branch information
asoto-iov committed Mar 8, 2024
1 parent d89ee92 commit e869aa7
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,12 @@ private Set<String> extractMethodNames(Class<?> remoteInterface) {
}

private JsonResponse buildError(Object id, int errorCode, String errorMessage) {
ObjectMapper mapper = new ObjectMapper();
ObjectNode response = mapper.createObjectNode();
ObjectNode response = objectMapper.createObjectNode();
response.put(JSONRPC, VERSION);
if(id != null) {
response.set(ID, mapper.valueToTree(id));
response.set(ID, objectMapper.valueToTree(id));
}
ObjectNode error = mapper.createObjectNode();
ObjectNode error = objectMapper.createObjectNode();
error.put(ERROR_CODE, errorCode);
error.put(ERROR_MESSAGE, errorMessage);

Expand Down

0 comments on commit e869aa7

Please sign in to comment.