title: Hibernate validate the @Enumerated(EnumType.STRING) field
body: <p>I have a POJO with one of the fields mapped using hibernate:</p>
  
  <pre><code>@Enumerated(EnumType.STRING)
  @Column(name = "status")
  private UserStatus status;
  </code></pre>
  
  <p>The enum has only 2 possible values: Activated and Deactivated</p>
  
  <p>In my Controller, I have this simple method for saving the entity in the db:</p>
  
  <pre><code>@PostMapping("/save")
  private UserDto saveUser(@RequestBody User user){
      return userService.save(user);
  }
  </code></pre>
  
  <p>If I try to save the user with an inexistent <code>UserStatus</code> I get the following error message:</p>
  
  <pre><code>"message": "JSON parse error: Cannot deserialize value of type `com.example.demo.utils.UserStatus` from String \"Deactivated1\": value not one of declared Enum instance names: [Deactivated, Activated]; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `com.example.demo.utils.UserStatus` from String \"Deactivated1\": value not one of declared Enum instance names: [Deactivated, Activated]\n at [Source: (PushbackInputStream); line: 3, column: 12] (through reference chain: com.example.demo.entity.User[\"status\"])",
  </code></pre>
  
  <p>How can I handle the serialization of inexistent values? I want to throw a custom exception in this case. Thank you!</p>