"Integrate OpenAPI/Swagger for API documentation with springdoc dep…#45
Conversation
…endency and annotations across controllers; update security settings and properties to expose Swagger UI."
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis pull request integrates OpenAPI/Swagger documentation support into the Spring Boot application by adding the Springdoc dependency, annotating controllers for API documentation grouping, configuring security to permit public access to documentation endpoints, and adding OpenAPI configuration properties. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 51 minutes and 6 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/java/com/example/boka/gymclass/infrastructure/AdminGymClassController.java (1)
21-21: Good: class-level@Tagcorrectly groups/api/adminendpoints under “Admin”.
@Tag(name = "Admin", description = ...)at the controller level should provide the expected grouping in the generated OpenAPI UI.Please verify in your running Swagger UI / OpenAPI JSON that:
- springdoc is scanning this controller package, and
- the tag appears as expected (e.g., operations under this controller show up under the “Admin” tag rather than “default”).
If you already standardize tags across controllers (as the PR summary suggests), consider keeping tag names/descriptions consistent via shared constants/enums to avoid drift over time.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/java/com/example/boka/gymclass/infrastructure/AdminGymClassController.java` at line 21, Verify that springdoc is scanning the package containing AdminGymClassController and that the `@Tag`(name = "Admin", description = "...") on AdminGymClassController appears in the generated OpenAPI JSON/Swagger UI (operations from this controller should be grouped under the "Admin" tag, not "default"); if it does not, update your springdoc configuration to include this package (or ensure component scanning of controllers) and reload the OpenAPI JSON to confirm. After verification, standardize tag usage by extracting the literal tag name/description into a shared constant or enum (e.g., ApiTags.ADMIN) and replace inline `@Tag` values on AdminGymClassController (and other controllers) to avoid drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/resources/application.properties`:
- Around line 42-44: Remove the undocumented springdoc.info.* properties from
application.properties (springdoc.info.title, springdoc.info.description,
springdoc.info.version) and instead define OpenAPI metadata via an
`@OpenAPIDefinition` annotated configuration class; create a config class (e.g.,
OpenApiConfig) annotated with `@Configuration` and `@OpenAPIDefinition`(info =
`@Info`(...)) setting title, description and version so Springdoc v3 picks them up
correctly.
---
Nitpick comments:
In
`@src/main/java/com/example/boka/gymclass/infrastructure/AdminGymClassController.java`:
- Line 21: Verify that springdoc is scanning the package containing
AdminGymClassController and that the `@Tag`(name = "Admin", description = "...")
on AdminGymClassController appears in the generated OpenAPI JSON/Swagger UI
(operations from this controller should be grouped under the "Admin" tag, not
"default"); if it does not, update your springdoc configuration to include this
package (or ensure component scanning of controllers) and reload the OpenAPI
JSON to confirm. After verification, standardize tag usage by extracting the
literal tag name/description into a shared constant or enum (e.g.,
ApiTags.ADMIN) and replace inline `@Tag` values on AdminGymClassController (and
other controllers) to avoid drift.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 214d4c65-860d-4342-903e-f144e0f9a63d
📒 Files selected for processing (9)
pom.xmlsrc/main/java/com/example/boka/booking/infrastructure/BookingController.javasrc/main/java/com/example/boka/gym/infrastructure/GymController.javasrc/main/java/com/example/boka/gymclass/infrastructure/AdminGymClassController.javasrc/main/java/com/example/boka/gymclass/infrastructure/ClassSearchController.javasrc/main/java/com/example/boka/security/AuthController.javasrc/main/java/com/example/boka/security/SecurityConfig.javasrc/main/java/com/example/boka/user/infrastructure/UserController.javasrc/main/resources/application.properties
… `OpenApiConfig` class using annotations for cleaner API documentation setup.
…endency and annotations across controllers; update security settings and properties to expose Swagger UI."
Summary by CodeRabbit