<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/code-review-buddy-ep01---review-spring-boot-rest-api-4ymacwwbq" -->

---
title: Code Review Buddy | EP01 - Review Spring Boot REST API
description: A live code review of an open-source home appliance manager Spring Boot REST API (Java 21, MySQL, JWT auth via Spring Security, Cloudinary for image storage)...
canonical: https://daily.dev/posts/code-review-buddy-ep01---review-spring-boot-rest-api-4ymacwwbq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Code Review Buddy | EP01 - Review Spring Boot REST API | daily.dev
og:description: A live code review of an open-source home appliance manager Spring Boot REST API (Java 21, MySQL, JWT auth via Spring Security, Cloudinary for image storage)...
og:url: https://daily.dev/posts/code-review-buddy-ep01---review-spring-boot-rest-api-4ymacwwbq
og:image: https://api.daily.dev/og/posts/4YMACWWbq.png
og:image:alt: Code Review Buddy | EP01 - Review Spring Boot REST API
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Review Buddy | EP01 - Review Spring Boot REST API

**[SivaLabs \(YouTube\)](https://daily.dev/sources/sivalabs-youtube)** · 66 min read · 0 upvotes · 0 comments

## Summary

A live code review of an open-source home appliance manager Spring Boot REST API (Java 21, MySQL, JWT auth via Spring Security, Cloudinary for image storage) is walked through in detail. Feedback covers dependency hygiene (unnecessary explicit deps, missing Lombok optional scope), using Spring Boot's Docker Compose support instead of manual setup, pinning MySQL image versions, JPA entity naming conventions and misuse of @AttributeOverrides, avoiding raw Map returns in favor of records/DTOs, proper use of @Transactional instead of catching and swallowing exceptions, RESTful URL design (products as sub-resources of users), a serious IDOR security vulnerability where any authenticated user can fetch another user's products by passing an arbitrary user ID, JWT encoder/decoder consolidation using Spring Security's OAuth2 resource server instead of mixing JJWT, and the complete absence of automated tests. The reviewer recommends Flyway for migrations, Testcontainers for integration tests, and MockMvcTester.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=dIMfe1gnWyc>

## Questions this post answers

### Is it a security risk to accept a user ID from the URL or request body in a Spring Boot REST API?

Yes, accepting a user ID directly from the URL or query parameters is a security vulnerability when access should be restricted to the logged-in user's own data. An authenticated user can pass any other user's ID and retrieve their product or invoice details. Instead, the current user should be resolved from the Spring Security context, and ownership of the requested resource should be explicitly verified before returning data.

_daily.dev surfaces practical writeups like this for developers hardening authorization logic in REST APIs._

### Why shouldn't I catch exceptions inside a @Transactional Spring Boot service method?

Catching and swallowing exceptions inside a @Transactional method prevents Spring from knowing an operation failed, so it commits the transaction even when part of the logic broke. Instead of catching errors and returning a boolean like true or false, the exception should be allowed to propagate so Spring can roll back all database changes made during that method, and a dedicated custom exception should be thrown to indicate the specific failure reason.

_developers debugging inconsistent transaction rollbacks in Spring Boot can find this kind of detail on daily.dev._

### Do I need both JJWT and Spring Security's OAuth2 resource server for JWT authentication in a Spring Boot app?

No, using JJWT together with OAuth2 resource server is redundant and considered a code smell. Spring Security's OAuth2 resource server library already provides both a JWT decoder and a JWT encoder, so the same component can be used for generating tokens at login and for decoding bearer tokens on incoming requests, removing the need for a separate JJWT-based encoding mechanism.

_teams choosing a JWT approach for Spring Boot APIs can track guidance like this on daily.dev._

## Similar posts on daily.dev

- [Build a Spring Boot REST API with Amazon Aurora DSQL](https://daily.dev/posts/build-a-spring-boot-rest-api-with-amazon-aurora-dsql-n9w0d0wit) · AWS Database Blog · 1 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#spring-boot](https://daily.dev/tags/spring-boot), [#code-review](https://daily.dev/tags/code-review), [#spring-security](https://daily.dev/tags/spring-security)

[View this post on daily.dev](https://daily.dev/posts/code-review-buddy-ep01---review-spring-boot-rest-api-4ymacwwbq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Code Review Buddy | EP01 - Review Spring Boot REST API","url":"https://daily.dev/posts/code-review-buddy-ep01---review-spring-boot-rest-api-4ymacwwbq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/code-review-buddy-ep01---review-spring-boot-rest-api-4ymacwwbq"},"datePublished":"2026-09-27T07:26:42.991Z","dateModified":"2026-09-27T07:53:29.574Z","description":"A live code review of an open-source home appliance manager Spring Boot REST API (Java 21, MySQL, JWT auth via Spring Security, Cloudinary for image storage)...","image":"https://i.ytimg.com/vi/dIMfe1gnWyc/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/dIMfe1gnWyc/sddefault.jpg","isAccessibleForFree":true,"articleSection":"SivaLabs (YouTube)","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SivaLabs (YouTube)","logo":"https://media.daily.dev/image/upload/s--8ATVo4an--/f_auto,q_auto/v1790493987/logos/sivalabs-youtube?_a=BAMAMicg0","url":"https://daily.dev/sources/sivalabs-youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/code-review-buddy-ep01---review-spring-boot-rest-api-4ymacwwbq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,spring-boot,code-review,spring-security","timeRequired":"PT66M","video":{"@type":"VideoObject","name":"Code Review Buddy | EP01 - Review Spring Boot REST API","description":"A live code review of an open-source home appliance manager Spring Boot REST API (Java 21, MySQL, JWT auth via Spring Security, Cloudinary for image storage)...","thumbnailUrl":"https://i.ytimg.com/vi/dIMfe1gnWyc/sddefault.jpg","uploadDate":"2026-09-27T07:26:42.991Z","duration":"PT66M","url":"https://api.daily.dev/r/4YMACWWbq","embedUrl":"https://www.youtube.com/embed/dIMfe1gnWyc"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SivaLabs (YouTube)","item":"https://daily.dev/sources/sivalabs-youtube"},{"@type":"ListItem","position":3,"name":"Code Review Buddy | EP01 - Review Spring Boot REST API"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/code-review-buddy-ep01---review-spring-boot-rest-api-4ymacwwbq#faq","mainEntity":[{"@type":"Question","name":"Is it a security risk to accept a user ID from the URL or request body in a Spring Boot REST API?","acceptedAnswer":{"@type":"Answer","text":"Yes, accepting a user ID directly from the URL or query parameters is a security vulnerability when access should be restricted to the logged-in user's own data. An authenticated user can pass any other user's ID and retrieve their product or invoice details. Instead, the current user should be resolved from the Spring Security context, and ownership of the requested resource should be explicitly verified before returning data. daily.dev surfaces practical writeups like this for developers hardening authorization logic in REST APIs."}},{"@type":"Question","name":"Why shouldn't I catch exceptions inside a @Transactional Spring Boot service method?","acceptedAnswer":{"@type":"Answer","text":"Catching and swallowing exceptions inside a @Transactional method prevents Spring from knowing an operation failed, so it commits the transaction even when part of the logic broke. Instead of catching errors and returning a boolean like true or false, the exception should be allowed to propagate so Spring can roll back all database changes made during that method, and a dedicated custom exception should be thrown to indicate the specific failure reason. developers debugging inconsistent transaction rollbacks in Spring Boot can find this kind of detail on daily.dev."}},{"@type":"Question","name":"Do I need both JJWT and Spring Security's OAuth2 resource server for JWT authentication in a Spring Boot app?","acceptedAnswer":{"@type":"Answer","text":"No, using JJWT together with OAuth2 resource server is redundant and considered a code smell. Spring Security's OAuth2 resource server library already provides both a JWT decoder and a JWT encoder, so the same component can be used for generating tokens at login and for decoding bearer tokens on incoming requests, removing the need for a separate JJWT-based encoding mechanism. teams choosing a JWT approach for Spring Boot APIs can track guidance like this on daily.dev."}}]}
```

