Conversation
Added a badge for DeepWiki to the README.
|
Warning Rate limit exceeded
⌛ 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. WalkthroughReplaces per-run GitHub Actions PR branch naming with a fixed branch and moves OpenAPI server configuration to environment-driven properties: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/main/java/com/iemr/tm/config/SwaggerConfig.java`:
- Line 23: Update the API description for the Swagger Info in SwaggerConfig so
it accurately describes the Scheduler API rather than beneficiaries; locate the
.info(new Info().title("Scheduler API")... ) call in the SwaggerConfig class and
replace the description string ("A microservice for the creation and management
of beneficiaries.") with a concise, correct description for the Scheduler API
(e.g., "A microservice for scheduling and managing tasks/jobs, triggers, and
schedules") ensuring the new text reflects the service purpose.
🧹 Nitpick comments (2)
src/main/java/com/iemr/tm/config/SwaggerConfig.java (2)
27-31: Consider using imports instead of inline fully-qualified class names.
java.util.Arraysandio.swagger.v3.oas.models.servers.Serverare used via FQCNs inline. Adding proper imports improves readability.Proposed fix
Add these imports at the top of the file:
import java.util.Arrays; import io.swagger.v3.oas.models.servers.Server;Then simplify the server list construction:
- .servers(java.util.Arrays.asList( - new io.swagger.v3.oas.models.servers.Server().url(devUrl).description("Dev"), - new io.swagger.v3.oas.models.servers.Server().url(uatUrl).description("UAT"), - new io.swagger.v3.oas.models.servers.Server().url(demoUrl).description("Demo") + .servers(Arrays.asList( + new Server().url(devUrl).description("Dev"), + new Server().url(uatUrl).description("UAT"), + new Server().url(demoUrl).description("Demo") ));
24-26: Security scheme name"my security"is vague.This name is user-visible in the Swagger UI. A more descriptive name like
"bearerAuth"would be clearer and is the conventional name for bearer token schemes.Proposed fix
- .addSecurityItem(new SecurityRequirement().addList("my security")) - .components(new Components().addSecuritySchemes("my security", - new SecurityScheme().name("my security").type(SecurityScheme.Type.HTTP).scheme("bearer"))) + .addSecurityItem(new SecurityRequirement().addList("bearerAuth")) + .components(new Components().addSecuritySchemes("bearerAuth", + new SecurityScheme().name("bearerAuth").type(SecurityScheme.Type.HTTP).scheme("bearer")))
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/main/java/com/iemr/tm/config/SwaggerConfig.java`:
- Line 26: Replace the placeholder version string in the Swagger Info builder
inside SwaggerConfig (the .info(new Info().title("Scheduler
API").version("version")...) call) with a real version value; either hard-code a
semantic version like "1.0.0" or pull the version from a build property (e.g.,
Maven/Gradle property interpolation or a
`@Value`("${project.version}")/application property) and pass that variable into
Info.version so the Swagger UI shows an actual release version.
🧹 Nitpick comments (1)
src/main/java/com/iemr/tm/config/SwaggerConfig.java (1)
28-29: Consider adding.bearerFormat("JWT")to the security scheme.This is a documentation hint that tells Swagger UI consumers the expected token format. It doesn't affect runtime but improves the developer experience for API consumers.
Proposed enhancement
.components(new Components().addSecuritySchemes("bearerAuth", - new SecurityScheme().name("bearerAuth").type(SecurityScheme.Type.HTTP).scheme("bearer"))) + new SecurityScheme().name("bearerAuth").type(SecurityScheme.Type.HTTP).scheme("bearer").bearerFormat("JWT")))
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/main/java/com/iemr/tm/config/SwaggerConfig.java`:
- Around line 22-35: The Swagger config's customOpenAPI is reading api.* URLs
from Environment but the "swagger" profile (and its
application-swagger.properties) is not being activated so env.getProperty falls
back to DEFAULT_SERVER_URL; enable the swagger profile by adding
spring.profiles.include=swagger to your main application.properties (or set
SPRING_PROFILES_ACTIVE to include "swagger" in your deployment), then verify the
property keys api.dev.url, api.uat.url and api.demo.url in
application-swagger.properties match those used by customOpenAPI and
DEFAULT_SERVER_URL remains the fallback.
🧹 Nitpick comments (2)
src/main/java/com/iemr/tm/config/SwaggerConfig.java (2)
29-30: Consider addingbearerFormat("JWT")to the security scheme.This helps Swagger UI tooling and documentation consumers understand the expected token format.
Suggested change
.components(new Components().addSecuritySchemes(BEARER_AUTH, - new SecurityScheme().name(BEARER_AUTH).type(SecurityScheme.Type.HTTP).scheme("bearer"))) + new SecurityScheme().name(BEARER_AUTH).type(SecurityScheme.Type.HTTP).scheme("bearer").bearerFormat("JWT")))
13-14: Nit: Java convention placesjava.*imports before third-party imports.
java.util.Arrays(line 13) is placed afterio.swaggerimports. Standard ordering isjava.*→javax.*→ third-party.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/main/resources/application.properties`:
- Line 37: The spring.profiles.include property currently enables the swagger
profile globally (spring.profiles.include=swagger); remove this line from the
base application.properties and instead enable the swagger profile only in
non-production environments by adding spring.profiles.include=swagger to
environment-specific properties (e.g., application-dev.properties or
application-local.properties) or by activating the profile via the
SPRING_PROFILES_ACTIVE environment variable in those environments; ensure no
global reference to the swagger profile remains in the base
application.properties so it won’t be active in production.
|



Summary by CodeRabbit