Defining error format is important part of REST API design. Spring-Boot and Spring Security provide pretty nice error handling for RESTful APIs out of the box. …