Json Mapping Exception can not deserialize instance out of START_ARRAY token

后端 未结 2 1299
孤街浪徒
孤街浪徒 2020-12-15 20:34

I\'m trying to parse my json request to my model. I dunno what is wrong in this code. Syntax of json looks correct and annotations on Java model also. I don\'t know why I\'m

2条回答
  •  独厮守ぢ
    2020-12-15 21:39

    A couple of corrections in your pojo class ,

    1)

    public class ParametersType {

    @JsonProperty( "parameter" )
    protected List parameter;
    

    ...}

    Corrected POJO:

    public class Parameters {

    @JsonProperty( "parameter" )
    protected List parameter;
    

    ...}

    1. Also documentFormat is a string but you have declared the type as class , protected DocumentFormatType documentFormat; Should be : protected String documentFormat;

提交回复
热议问题