Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/resources/application-swagger.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ secondary.datasource.username=<Enter_Username>
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.


springdoc.api-docs.enabled=true
springdoc.swagger-ui.enabled=true
Expand Down
Loading