k

    kds

    4 years ago
    Hi. I have a data class
    data class SID(
            @Pattern(regexp="[0-9a-zA-Z]{1,50}", message = "Недопустимые символы в SID")
            val sid: String
    ) {
        override fun toString(): String {
            return sid
        }
    }
    The jackson v. 2.9.7 shows me an error when I try to deserialize SID from string in message
    {
      "sid": "qweasdzxc",
      "date": 1537893098
    }
    Error:
    com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `SID` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('qweasdzxc')
     at [Source: (String)"{
        "sid":"qweasdzxc",
        "date":1537893098,
    ...
    h

    hho

    4 years ago
    Do you have the
    jackson-module-kotlin
    loaded?