Error - Cannot define Creator property "posicao" as `@JsonUnwrapped`: combination not yet supported

Viewed 12

I'm having a problem serializing/deserializing a json , the error is as follows:

Failed to evaluate Jackson deserialization for type [[simple type, class com.challenge.model.Sense]]: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot define Creator property "position" as @JsonUnwrapped: combination not yet supported

My version of Jackson is 2.13

My class is as follows:

import com.fasterxml.jackson.annotation.JsonCreator; 
import com.fasterxml.jackson.annotation.JsonProperty; 
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.io.Serializable;

public class Sense implements Serializable {

    private static final long serialVersionUID = -4060851020632500627L;
    private final Moves moves;
    private final Position position;

    @JsonCreator
    public Sense(@JsonProperty(value = "position") @JsonUnwrapped Position position,
                   @JsonProperty(value = "moves") Moves moves) {
        this.position = position;
        this.moves = moves;
    }

    public Position getPosition() {
        return position;
    }

    public Moves getMovements() {
        return moves;
    }
}

Any suggestion?

0 Answers
Related