title: Kotlin data class to JSON with spring/jackson
body: <p>I'm tryin to expose some data class as JSON objects but something ain't working.</p>
  
  <p>I have the following data classes:</p>
  
  <pre><code>data class Link(
          @JsonProperty("rel")
          @JsonView(View.Bind::class)
          val rel: String,
  
          @JsonProperty("method")
          @JsonView(View.Bind::class)
          val method: HttpMethod,
  
          @JsonProperty("href")
          @JsonView(View.Bind::class)
          val href: String)
  
  
  data class MetaData(val status: HttpStatus) {
      @JsonView(View.Bind::class)
      @JsonProperty("status_code")
      fun getStatusCode(): Int {
          return status.value()
      }
  
      @JsonView(View.Bind::class)
      @JsonProperty("status_desc")
      fun getStatusDesc(): String {
          return status.name
      }
  }
  
  data class Payload(
          @JsonView(View.Bind::class)
          @JsonProperty("payload")
          val payload: Any,
  
          @JsonProperty("_meta")
          @JsonView(View.Bind::class)
          val metaData: MetaData,
  
          @JsonProperty("_links")
          @JsonView(View.Bind::class)
          val links: List&lt;Link&gt;)
  </code></pre>
  
  <p>And for some reason, when the Payload class is a JAVA class everything works fine, but when it is a kotlin class only the payload element gets into the JSON.</p>
  
  <p>For dependency i'm using:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
      &lt;artifactId&gt;kotlin-stdlib&lt;/artifactId&gt;
      &lt;version&gt;1.0.1-1&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.module&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-module-kotlin&lt;/artifactId&gt;
      &lt;version&gt;2.7.1-2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>If i change the "_meta" and "_links" to "meta" and "links" the "links" elements are rendered.</p>