How to save many objects in the same request using Spring Boot Data Rest

我的梦境 提交于 2019-12-04 18:20:34

What is wrong is that is trying to read your request body as an Item, when it is in fact multiple Items.

I believe you have two choices here. What I would normally do in this situation would be to create another resource, such as ItemCollection, to wrap multiple Items. Then you could have standard REST functionality to take in an ItemCollection, which would essentially handle multiple Items.

Your second option would be to manually override a method to handle multiple itmes: http://docs.spring.io/spring-data/rest/docs/current/reference/html/#customizing-sdr.overriding-sdr-response-handlers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!