title: Error validation message format Spring boot
body: <p>i am new using Java and Spring boot, im  trying to validate a json input that will be stored in DB, the validation is doing well, the problem is the response format, i think it is not readable for a client as Angular JS, in need to know how to change the output format from this :</p>
  
  <pre><code>{
  "error": {
      "code": 400,
      "message": "Validation failed for classes [com.company.customerhelpcenter.domain.Ticket] during persist time for groups [javax.validation.groups.Default, ]\nList of constraint violations:[\n\tConstraintViolationImpl{interpolatedMessage='Descripción no puede ser null', propertyPath=description, rootBeanClass=class com.company.customerhelpcenter.domain.Ticket, messageTemplate='Descripción no puede ser null'}\n\tConstraintViolationImpl{interpolatedMessage='not a well-formed email address', propertyPath=email, rootBeanClass=class com.company.customerhelpcenter.domain.Ticket, messageTemplate='{org.hibernate.validator.constraints.Email.message}'}\n\tConstraintViolationImpl{interpolatedMessage='Número de teléfono no puede ser null', propertyPath=phone, rootBeanClass=class com.company.customerhelpcenter.domain.Ticket, messageTemplate='Número de teléfono no puede ser null'}\n]"
  }}
  </code></pre>
  
  <p>to this</p>
  
  <pre><code>{
  "error": {
      "description" : "Description cannot be null",
      "email": "Email cannot be null",
      "phone": "Phone cannot be null"
  } }
  </code></pre>
  
  <p>This is my controller </p>
  
  <pre><code>@PostMapping
  public ResponseEntity&lt;?&gt; create(@RequestBody Ticket ticket)
  {
      return new ResponseEntity&lt;&gt;(this.ticketService.create(ticket), HttpStatus.CREATED);
  }
  </code></pre>
  
  <p>Service:</p>
  
  <pre><code>public Ticket create(Ticket ticket)
  {
      return this.ticketRepository.save(ticket);
  }
  </code></pre>
  
  <p>Repository:</p>
  
  <pre><code>@Repository
  public interface TicketRepository extends JpaRepository&lt;Ticket, Integer&gt;, Serializable
  {}
  </code></pre>
  
  <p>Entity</p>
  
  <pre><code>@Entity
  @Table(name = "ticket")
  public class Ticket implements Serializable
  {
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Basic(optional = false)
      @Column(name = "id")
      private Integer id;
  
      @Basic(optional = false)
      @NotNull(message = "Descripción no puede ser null")
      @Size(min = 1, max = 255)
      @Column(name = "description")
      private String description;
  
      @Basic(optional = false)
      @NotNull(message = "Número de teléfono no puede ser null")
      @Size(min = 1, max = 20)
      @Column(name = "phone")
      private String phone;
  
      @Basic(optional = false)
      @NotNull(message = "Email no puede ser null")
      @Size(min = 1, max = 80)
      @Email
      @Column(name = "email")
      private String email;
  
      @Basic(optional = false)
      @NotNull
      @Column(name = "locked")
      private boolean locked;
  
      @JoinColumn(name = "ticket_type_id", referencedColumnName = "id")
      @ManyToOne(optional = false, fetch = FetchType.EAGER)
      @Exclude
      private TicketType ticketType;
  
      @OneToMany(mappedBy = "ticket")
      private Set&lt;TicketHistory&gt; ticketHistories = new HashSet&lt;TicketHistory&gt;();
  
  
      public Integer getId()
      {
          return this.id;
      }
  
      public String getDescription()
      {
          return this.description;
      }
  
      public String getPhone()
      {
          return this.phone;
      }
  
      public String getEmail()
      {
          return this.email;
      }
  
      public TicketType getTicketType()
      {
          return this.ticketType;
      }
  
      public boolean isLocked()
      {
          return this.locked;
      }
  
      public Set&lt;TicketHistory&gt; getTicketHistories()
      {
          return this.ticketHistories;
      }
  }
  </code></pre>