Вы можете попробовать это -
ObjectMapper mapper = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT);
try {
String json = mapper.writeValueAsString(<your-class-here>);
System.out.println(json);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
Просто замените "your-class-here" на сгенерированную ссылку на объект.