Spring Boot - Request and Response Handling
Given the following DTO and controller method, what will happen if the client sends a request with an empty createUser(@Valid @RequestBody UserDTO user) {
return ResponseEntity.ok("User created");
}
email field?
public class UserDTO {
@NotBlank
private String email;
// getters and setters
}
@PostMapping("/users")
public ResponseEntity