Jackson

Pretty print JSON response in spring boot

Pretty print JSON response in spring boot

Ashish Lahoti

When you create a Spring @RestController in a Spring Boot application to define API endpoints then it renders JSON response by default if jackson2 is in classpath.

JSON responses are not pretty print by default but you can enable it with just one property change.