title: How do you make Jackson use Kotlin default params for missing values?
body: <p>I've a Kotlin data class that looks like this,</p>
  
  <pre><code>data class SomeData(
     private val notInJson: String = "some default value",
     private val inJson: String
  )
  </code></pre>
  
  <p>and a json string, I wish to deserialize into an instance of this class -</p>
  
  <pre><code>{
      "inJson" : "value"
  }
  </code></pre>
  
  <p>When I try to deserialize this data, I get an error that the parameter <code>notInJson</code> cannot be null. Seems like Jackson is passing a null value for it since it's missing in the json string. </p>
  
  <p>Is there a way to have Jackson not pass in any value for it, so that the default specified in the class definition could be used?</p>
  
  <p>--EDIT--</p>
  
  <p>I do register a KotlinModule() with the mapper. Using version 2.7.8 or all jackson packages involved.</p>
  
  <p>The following code -</p>
  
  <pre><code>@Test fun jackson_kotlin_module() {
      val mapper = ObjectMapper().registerModule(KotlinModule())
      println(
          mapper.readValue("""{ "inJson" : "some value" }""",     SomeData::class.java))
  }
  </code></pre>
  
  <p>gives me -</p>
  
  <pre><code>com.fasterxml.jackson.databind.JsonMappingException: Instantiation of [simple 
  type, class SomeData] value failed (java.lang.IllegalArgumentException): 
  Parameter specified as non-null is null: method SomeData.&lt;init&gt;, parameter 
  notInJson
  at [Source: { "inJson" : "some value" }; line: 1, column: 27]
  </code></pre>