Skip to content

fix: add missing property for swagger#401

Open
vanitha1822 wants to merge 1 commit intomainfrom
nd/vs/swagger_fix
Open

fix: add missing property for swagger#401
vanitha1822 wants to merge 1 commit intomainfrom
nd/vs/swagger_fix

Conversation

@vanitha1822
Copy link
Copy Markdown
Member

@vanitha1822 vanitha1822 commented Apr 28, 2026

📋 Description

JIRA ID:

AMM-2280


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)

Summary by CodeRabbit

  • Chores
    • Added configuration property for temporary file path handling to support internal processes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

A new configuration property tempFilePath is added to the Swagger application properties file with the value temp. This enables configuration of a temporary file path for components requiring temporary storage during Swagger documentation generation.

Changes

Cohort / File(s) Summary
Configuration Addition
src/main/resources/application-swagger.properties
Added new property tempFilePath=temp to provide configurable temporary file path for Swagger-related operations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A tiny path is planted here,
tempFilePath so clear,
Where fleeting files may rest and play,
Before they hop and scamper away! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a missing tempFilePath property to the Swagger configuration file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nd/vs/swagger_fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vanitha1822 vanitha1822 self-assigned this Apr 28, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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-swagger.properties`:
- Line 26: Replace the brittle relative default by setting tempFilePath to an
absolute, env-overridable system temp directory (e.g. use a property like
tempFilePath=${TEMP_DIR:${java.io.tmpdir}/myapp} or similar) in
application-swagger.properties so callers get a writable default; then add
startup validation in the initialization that uses tempFilePath (the code that
opens FileOutputStream/FileInputStream) to call
Files.createDirectories(Paths.get(tempFilePath)) and verify write permission,
failing fast with a clear error if the directory cannot be created or written
to.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: f51a5111-aca8-4dac-9b60-35a280d48c18

📥 Commits

Reviewing files that changed from the base of the PR and between 9f23f79 and b243fd5.

📒 Files selected for processing (1)
  • src/main/resources/application-swagger.properties

secondary.datasource.password=<Enter_Password>
secondary.datasource.url=jdbc:h2:mem:reportingdb
secondary.datasource.driver-class-name=org.h2.Driver
tempFilePath=temp
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use a writable temp-directory default instead of a relative path

tempFilePath=temp is brittle: it depends on process working directory and can break file I/O when that directory is missing or read-only (the service uses this path directly for FileOutputStream/FileInputStream). Prefer an env-overridable absolute temp default.

Suggested change
-tempFilePath=temp
+tempFilePath=${TEMP_FILE_PATH:${java.io.tmpdir}/amrit-swagger}

Also ensure the target directory is created/validated at startup before writes.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tempFilePath=temp
tempFilePath=${TEMP_FILE_PATH:${java.io.tmpdir}/amrit-swagger}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/application-swagger.properties` at line 26, Replace the
brittle relative default by setting tempFilePath to an absolute, env-overridable
system temp directory (e.g. use a property like
tempFilePath=${TEMP_DIR:${java.io.tmpdir}/myapp} or similar) in
application-swagger.properties so callers get a writable default; then add
startup validation in the initialization that uses tempFilePath (the code that
opens FileOutputStream/FileInputStream) to call
Files.createDirectories(Paths.get(tempFilePath)) and verify write permission,
failing fast with a clear error if the directory cannot be created or written
to.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant