title: kotlin and @Valid Spring annotation
body: <p>I have an entity:</p>
  
  <pre><code>class SomeInfo(
          @NotNull @Pattern(regexp = Constraints.EMAIL_REGEX) var value: String) {
      var id: Long? = null
  }
  </code></pre>
  
  <p>And controller method:</p>
  
  <pre><code>@RequestMapping(value = "/some-info", method = RequestMethod.POST)
  public Id create(@Valid @RequestBody SomeInfo someInfo) {
         ...
      }
  </code></pre>
  
  <p><code>@Valid</code> annotation doesn't work.</p>
  
  <p>It seems Spring needs a default parameterless constructor and fancy code above becomes in something ugly (but working) like this:</p>
  
  <pre><code>class SomeInfo() {
  
      constructor(value: String) {
              this.value = value
          }
  
          @NotNull @Pattern(regexp = Constraints.EMAIL_REGEX) 
          lateinit var value: String
  
          var id: Long? = null
      }
  </code></pre>
  
  <p>Any good practice to make it less wordy?</p>
  
  <p>Thanks.</p>