DEV Community

Discussion on: How to create simple rest apis with springboot

Collapse
 
martin profile image
Martin Beentjes

Looks good, I would recommend updating Spring Boot to 2.1.0. Besides that, don't use 'Test' in such tutorials. Keep them realistic and use something like "getAll()" or something.

Why don't you use ResponseEntity<>?

And another good improvement would be to explain how a request flows from the browser of the user through the (Rest)Controller to the Service and into the Repository if needed.

Collapse
 
adityasridhar profile image
Aditya Sridhar

Thank you for the feedback :)

Will use proper naming conventions in the next one :D

I could have used response entity as well. Maybe will use that in the next article.

Planning to write one more article for the flow from controller to service to repository. That's the reason I did not include it here. Wanted to separate them out since having them in one article makes the article long and readers may feel its too much information in one article.

Collapse
 
martin profile image
Martin Beentjes

I prefer to use ResponseEntity because it is Spring itself as the tutorial focuses on Spring.

Good luck!