Skip to content

Instantly share code, notes, and snippets.

@jmakeig
Created May 21, 2019 06:32
Show Gist options
  • Save jmakeig/83dbc70b7a9e7a7297a20d96883eefae to your computer and use it in GitHub Desktop.
Save jmakeig/83dbc70b7a9e7a7297a20d96883eefae to your computer and use it in GitHub Desktop.
Pretty print a Jackson JsonNode to the console
try {
System.out.println(
new ObjectMapper()
.writerWithDefaultPrettyPrinter()
.writeValueAsString(api)
);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment