Hello, I'm having a problem with deserializing obj...
# jackson-kotlin
j
Hello, I'm having a problem with deserializing object using delegate interface, any ideas?
Copy code
class FooRequest(
    private val payload: PayloadImpl,
    override val someInterfaceField: Boolean
) : Payload by payload, SomeInterface
that one does not work but this will work without having additional "payload" object in JSON, I wonder why that is
Copy code
class FooRequest(
    private val payload: PayloadImpl
) : Payload by payload
alson @JsonUnwrapped does not work for deserialization because then I get problem described in
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot define Creator property "payload" as `@JsonUnwrapped`: combination not yet supported
What I would like to know is why the latter example behaves like its magically using @JsonUnrapped somehow
a
Istr that when the target class for deserialization has a single-parameter constructor, Jackson automagically supports deserializing to that constructor parameter and then calling the constructor - sort of an implicit builder pattern. I’ve certainly used this for constructing objects from strings during deserialization in the past