Deserialize ArrayList from String using Jackson

前端 未结 2 1757
借酒劲吻你
借酒劲吻你 2020-12-11 06:38

I am using Spring\'s MappingJacksonHttpMessageConverter to convert JSON message to object in my controller.



        
2条回答
  •  悲&欢浪女
    2020-12-11 07:04

    Check out this article describing how to use the features of the jackson objectMapper to accomplish this.

    https://github.com/FasterXML/jackson-dataformat-xml/issues/21

    For me adding the following solved this issue

    jsonMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
    

提交回复
热议问题