I have a following data class in kotlin. The deser...
# jackson-kotlin
k
I have a following data class in kotlin. The deserializer fails randomly by selecting the second constructor. If I remove the second constructor, it always works. I added @JsonCreator annotation, why jackson uses the second constructor sometimes?
Copy code
data class PostalAddress @JsonCreator constructor(
        val streetAddress1: String? = null,
        val streetAddress2: String? = null,
        val city: String? = null,
        val stateProvince: String? = null,
        val postalCode: String? = null,
        val postalCodePlusFour: String? = null,
        val countryCode: String? = null,
        val validated: Boolean? = null
) : Serializable {
    constructor(@JsonProperty("postalCode") postalCode: String) : this(null, null, null, null, postalCode, null, null, false)