title: Usage of Jackson @JsonProperty annotation for kotlin data classes
body: <p>kotlin 1.2.10
  jackson-module-kotlin:2.9.0</p>
  
  <p>I have the following data class in kotlin:</p>
  
  <pre><code>data class CurrencyInfo(
          @JsonProperty("currency_info") var currencyInfo: CurrencyInfoItem?
  )
  
  @JsonInclude(JsonInclude.Include.NON_NULL)
  data class CurrencyInfoItem(
          @JsonProperty("iso_4217") var iso4217: String?,
          @JsonProperty("name") var name: String?,
          @JsonProperty("name_major") var nameMajor: String?,
          @JsonProperty("name_minor") var nameMinor: String?,
          @JsonProperty("i_ma_currency") var iMaCurrency: Int?,
          @JsonProperty("i_merchant_account") var iMerchantAccount: Int?,
          @JsonProperty("i_x_rate_source") var iXRateSource: Int?,
          @JsonProperty("base_units") var baseUnits: Double?,
          @JsonProperty("min_allowed_payment") var minAllowedPayment: Int?,
          @JsonProperty("decimal_digits") var decimalDigits: Int?,
          @JsonProperty("is_used") var isUsed: Boolean?
  )
  </code></pre>
  
  <p>When I try to deserialize this data class I get the following:</p>
  
  <pre><code>{"currency_info":{"iso_4217":"CAD","name":"Canadian Dollar","imerchantAccount":0,"ixrateSource":2}}
  </code></pre>
  
  <p>As you can see, the last two options were deserialized incorrectly.
  This issue could be solved by adding directly annotation to getter @get:JsonProperty. However, according to jackson docs @JsonProperty should be assigned to getters/setters/fields</p>
  
  <p>So, I want to ask is there a reliable way to annotate property for jackson in kotlin to have correct serialization/deserialization (moreover all my data classes are autogenerated, so it would be hard to create some two/three lines annotations, separately for getter and setter)</p>
  
  <p>Otherwise, could this issue be resolved by some jackson settings?</p>
  
  <p>According to answers below, the following works for me</p>
  
  <pre><code>private val mapper = ObjectMapper().registerKotlinModule()
  .setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
  .setVisibility(PropertyAccessor.CREATOR, JsonAutoDetect.Visibility.NONE)
  .setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.NONE)
  .setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.NONE)
  .setVisibility(PropertyAccessor.IS_GETTER, JsonAutoDetect.Visibility.NONE)
  </code></pre>