How to enforce ACCEPT_SINGLE_VALUE_AS_ARRAY in jackson's deserialization process using annotation

后端 未结 4 2090
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 14:27

Is there a way to use annotation on a List property in a class to use ACCEPT_SINGLE_VALUE_AS_ARRAY in Jackson? I\'m using Spring and getting the b

4条回答
  •  -上瘾入骨i
    2020-12-01 14:48

    If this project is a Spring project then you can put this property in you application.properties:

    spring.jackson.deserialization.UNWRAP_SINGLE_VALUE_ARRAYS=true

提交回复
热议问题