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
⌛
This post has been reserved for your question.
Hey @YoungMoneyMitch! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
If the same endpoint is taking in two lists, then yes, wrapper class is best.
Ok thank you!
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.
Post Closed
This post has been closed by <@927297953020932186>.