Spring MVC - @Valid on list of beans in REST service

后端 未结 10 2185
醉酒成梦
醉酒成梦 2020-11-29 23:05

In a Spring MVC REST service (json), I have a controller method like this one :

@RequestMapping(method = RequestMethod.POST, value = { \"/doesntmatter\" })
         


        
10条回答
  •  眼角桃花
    2020-11-29 23:39

    I think your best option is to wrap the list - How to validate request parameter if it is not a bean in spring MVC?

    There is no way atm to say that the @Valid applies to the elements of the collection.

提交回复
热议问题