Can not deserialize instance of java.util.ArrayList out of VALUE_STRING

前端 未结 5 1675
谎友^
谎友^ 2020-11-30 04:41

I have a REST service built with Jersey and deployed in the AppEngine. The REST service implements the verb PUT that consumes an application/json media type. Th

5条回答
  •  被撕碎了的回忆
    2020-11-30 05:11

    from Jackson 2.7.x+ there is a way to annotate the member variable itself:

     @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
     private List newsletters;
    

    More info here: Jackson @JsonFormat

提交回复
热议问题