Spring Boot Request Body

Howdy Everybody! I am creating a simple API that takes in two lists that hold different objects. Right now I am using the @RequestBody annotation in the controller to map the data to an object but now I don't know how to do it with different lists. Do I need a wrapper class? If so is it better to make a custom wrapper or use a Map? All help is appreciated!
5 Replies
JavaBot
JavaBot2y ago
This post has been reserved for your question.
Hey @YoungMoneyMitch! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Crain
Crain2y ago
If the same endpoint is taking in two lists, then yes, wrapper class is best.
YoungMoneyMitch
YoungMoneyMitchOP2y ago
Ok thank you!
JavaBot
JavaBot2y ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot2y ago
Post Closed
This post has been closed by <@927297953020932186>.
Want results from more Discord servers?
Add your server