Skip to content

Feature/#14 swagger setting - #15

Merged
Anna0626 merged 3 commits into
developfrom
feature/#14-swagger-setting
Jul 7, 2026
Merged

Feature/#14 swagger setting#15
Anna0626 merged 3 commits into
developfrom
feature/#14-swagger-setting

Conversation

@Anna0626

@Anna0626 Anna0626 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

이슈: #14

Summary by CodeRabbit

  • New Features

    • Added API documentation support with interactive Swagger/OpenAPI pages.
    • Included OpenAPI metadata and a bearer token security definition in the generated docs.
  • Bug Fixes

    • Allowed documentation-related routes to load without authentication.
    • Kept all other endpoints protected as before.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Springdoc OpenAPI starter dependencies to build.gradle, introduces a new SwaggerConfig class defining an OpenAPI bean with metadata, server URL, and Bearer JWT security scheme, and updates SecurityConfig to permit unauthenticated access to Swagger/OpenAPI documentation endpoints.

Changes

Swagger/OpenAPI Integration

Layer / File(s) Summary
Springdoc dependencies and OpenAPI bean
build.gradle, src/main/java/com/stology/be/global/config/SwaggerConfig.java
Adds Springdoc OpenAPI starter dependencies and a new SwaggerConfig class exposing an OpenAPI bean with title/description/version, a / server URL, and an HTTP Bearer JWT security scheme with a matching security requirement.
Security rules for Swagger endpoints
src/main/java/com/stology/be/global/security/config/SecurityConfig.java
Expands the permitAll request matchers to include /swagger-ui/**, /swagger-resources/**, and /v3/api-docs/** alongside existing /login and /oauth2/** routes.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Sequence Diagram(s)

Not applicable — the changes are configuration additions without multi-component sequential flow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the PR and reflects the Swagger/OpenAPI setup, though it is a bit terse and issue-number heavy.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/#14-swagger-setting

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
build.gradle (1)

31-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant explicit dependency on springdoc-openapi-starter-webmvc-api.

springdoc-openapi-starter-webmvc-ui already declares springdoc-openapi-starter-webmvc-api as a direct dependency in its own POM, so it's pulled in transitively. Declaring both explicitly is unnecessary and can complicate future version bumps (two lines to keep in sync).

♻️ Proposed simplification
-    implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.1'
-    implementation 'org.springdoc:springdoc-openapi-starter-webmvc-api:3.0.1'
+    implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.1'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@build.gradle` around lines 31 - 32, The dependency list in build.gradle is
redundant because springdoc-openapi-starter-webmvc-ui already brings in
springdoc-openapi-starter-webmvc-api transitively. Remove the explicit
springdoc-openapi-starter-webmvc-api declaration and keep only the
springdoc-openapi-starter-webmvc-ui dependency so dependency management stays
simpler; use the springdoc dependency entries in the Gradle file to locate the
change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@build.gradle`:
- Around line 31-32: The springdoc dependencies in the build script are pinned
to a version that is not compatible with the current Spring Boot release. Update
the springdoc artifacts referenced in the build configuration to a release that
supports Spring Boot 4.1.0, or alternatively align the Spring Boot version to
the supported 4.0.x line; keep the change centered on the springdoc dependency
declarations so the build stays dependency-compatible.

In `@src/main/java/com/stology/be/global/security/config/SecurityConfig.java`:
- Line 24: Update SecurityConfig’s requestMatchers permit list to include the
Swagger UI/docs entrypoints that springdoc exposes, since the current
configuration can still block them with 401. Extend the existing permitAll
matcher in SecurityConfig so it explicitly allows /swagger-ui.html and
/v3/api-docs.yaml alongside the current /swagger-ui/** and /v3/api-docs/**
patterns.

---

Nitpick comments:
In `@build.gradle`:
- Around line 31-32: The dependency list in build.gradle is redundant because
springdoc-openapi-starter-webmvc-ui already brings in
springdoc-openapi-starter-webmvc-api transitively. Remove the explicit
springdoc-openapi-starter-webmvc-api declaration and keep only the
springdoc-openapi-starter-webmvc-ui dependency so dependency management stays
simpler; use the springdoc dependency entries in the Gradle file to locate the
change.
🪄 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 Plus

Run ID: 34b49e68-80a6-4948-a662-1250f0df0664

📥 Commits

Reviewing files that changed from the base of the PR and between 2be340e and 67828ef.

📒 Files selected for processing (3)
  • build.gradle
  • src/main/java/com/stology/be/global/config/SwaggerConfig.java
  • src/main/java/com/stology/be/global/security/config/SecurityConfig.java

Comment thread build.gradle
Comment on lines +31 to +32
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.1'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-api:3.0.1'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: find the declared Spring Boot version/plugin in build.gradle
rg -n "org.springframework.boot|spring-boot" build.gradle

Repository: Stology/BE

Length of output: 764


🌐 Web query:

springdoc-openapi 3.0.1 Spring Boot 4.1 compatibility release notes support matrix

💡 Result:

The springdoc-openapi version 3.0.1 is not compatible with Spring Boot 4.1. The 3.0.1 release of springdoc-openapi was released on January 1, 2026 [1][2], and it specifically upgraded support for Spring Boot 4.0.1 [1][2]. Spring Boot 4.1 was released later, on June 10, 2026 [3][4]. To use Spring Boot 4.1, you should look for a more recent version of springdoc-openapi, as the library releases are typically aligned to support specific Spring Boot major and minor versions through subsequent updates [5]. According to historical release patterns, later versions of springdoc-openapi (such as those released after June 2026) include the necessary upgrades to support Spring Boot 4.1 [5]. You can verify the latest compatible version by checking the official springdoc-openapi releases page [5].

Citations:


springdoc 3.0.1 doesn’t match Spring Boot 4.1.0
springdoc-openapi 3.0.1 targets Spring Boot 4.0.1, while this project uses Spring Boot 4.1.0. Bump springdoc to a 4.1-compatible release, or align Boot to the supported 4.0.x line, to avoid dependency/runtime issues.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@build.gradle` around lines 31 - 32, The springdoc dependencies in the build
script are pinned to a version that is not compatible with the current Spring
Boot release. Update the springdoc artifacts referenced in the build
configuration to a release that supports Spring Boot 4.1.0, or alternatively
align the Spring Boot version to the supported 4.0.x line; keep the change
centered on the springdoc dependency declarations so the build stays
dependency-compatible.

http
.authorizeHttpRequests(auth -> auth
.requestMatchers("/login", "/oauth2/**").permitAll()
.requestMatchers("/login", "/oauth2/**", "/swagger-ui/**", "/swagger-resources/**", "/v3/api-docs/**").permitAll()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the security config around the matcher list.
sed -n '1,220p' src/main/java/com/stology/be/global/security/config/SecurityConfig.java

printf '\n--- springdoc references ---\n'
rg -n "springdoc|swagger-ui|v3/api-docs|swagger-resources" -S .

printf '\n--- dependency files ---\n'
git ls-files | rg '(^pom\.xml$|^build\.gradle(\.kts)?$|^settings\.gradle(\.kts)?$|gradle\.properties$|libs\.versions\.toml$)'

Repository: Stology/BE

Length of output: 2413


🌐 Web query:

Springdoc OpenAPI starter webmvc ui 3.0.1 default endpoints /swagger-ui.html /swagger-ui/index.html /v3/api-docs.yaml

💡 Result:

In springdoc-openapi 3.0.1, the default endpoints for accessing the Swagger UI and OpenAPI documentation are as follows: - Swagger UI: The primary default URL is /swagger-ui.html [1][2]. - OpenAPI JSON documentation: The default URL is /v3/api-docs [1][2]. - OpenAPI YAML documentation: The default URL is /v3/api-docs.yaml [1]. While /swagger-ui/index.html is often mentioned in contexts related to the internal routing of the underlying webjars or as an alternative entry point in some configurations, /swagger-ui.html is the standard, documented default path for accessing the UI [1][2]. These endpoints are served on the application's main port and context path by default [1]. You can customize these paths using the following configuration properties in your application properties or YAML file: - To change the Swagger UI path: springdoc.swagger-ui.path=/your-custom-path/swagger-ui.html [3][1] - To change the OpenAPI JSON path: springdoc.api-docs.path=/your-custom-path/v3/api-docs [4][5] If you encounter issues or need to secure these endpoints, ensure that your security configuration (such as Spring Security) explicitly permits access to these paths [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for any local springdoc path overrides.
rg -n "springdoc|swagger-ui|api-docs|swagger-ui.html" -S src main resources . --glob '!build/**' --glob '!out/**' --glob '!target/**'

# Read build.gradle for exact springdoc artifact versions.
sed -n '1,120p' build.gradle

Repository: Stology/BE

Length of output: 864


Add the Swagger UI/docs entrypoints to the permit list. springdoc-openapi-starter-webmvc-ui:3.0.1 exposes /swagger-ui.html, /v3/api-docs, and /v3/api-docs.yaml, so the current matchers can still return 401 before the UI or YAML docs load.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/com/stology/be/global/security/config/SecurityConfig.java` at
line 24, Update SecurityConfig’s requestMatchers permit list to include the
Swagger UI/docs entrypoints that springdoc exposes, since the current
configuration can still block them with 401. Extend the existing permitAll
matcher in SecurityConfig so it explicitly allows /swagger-ui.html and
/v3/api-docs.yaml alongside the current /swagger-ui/** and /v3/api-docs/**
patterns.

@Anna0626
Anna0626 changed the base branch from main to develop July 7, 2026 03:14
@Anna0626
Anna0626 merged commit 4950f49 into develop Jul 7, 2026
1 check passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 8, 2026
GiY5ngKim added a commit that referenced this pull request Jul 12, 2026
feat: 리포트용 Gemini AI 연동 인프라 구축 및 프롬프트 템플릿 설계
GiY5ngKim added a commit that referenced this pull request Jul 13, 2026
chore/#28 Gemini API URL 환경변수 분리
GiY5ngKim added a commit that referenced this pull request Jul 21, 2026
Feature/#15 report : AI 리포트 OpenAI 마이그레이션 및 시큐리티
GiY5ngKim added a commit that referenced this pull request Jul 21, 2026
GiY5ngKim added a commit that referenced this pull request Jul 21, 2026
Feature/#15 report : 리포트 전용 예외 처리 분리 및 에러 세분화
GiY5ngKim added a commit that referenced this pull request Jul 22, 2026
fix/#50 report: 프롬포트 수정 및 코드 가독성 개선
GiY5ngKim added a commit that referenced this pull request Jul 26, 2026
# Conflicts:
#	src/main/java/com/stology/be/domain/report/dto/response/ReportResponseDto.java
#	src/main/java/com/stology/be/domain/report/service/ReportService.java
GiY5ngKim added a commit that referenced this pull request Jul 26, 2026
refactor: Service 최적화 및 타 도메인 의존성 제거 (스케줄러, 레포지토리 이전)
GiY5ngKim added a commit that referenced this pull request Jul 26, 2026
Feature : 리포트 테스트용 삭제 및 갱신 기능 추가
GiY5ngKim added a commit that referenced this pull request Jul 29, 2026
Feature/#15 report 핵심 노드 쿼리 개선, state 값 명확화, 주차 탭 데이터 추가, 데드코드 제거
GiY5ngKim added a commit that referenced this pull request Jul 31, 2026
feature/#66 스케줄러 수정 및 안 읽은 리포트 관리 기능 추가
GiY5ngKim added a commit that referenced this pull request Jul 31, 2026
refactor/#67 ReportService 내부 EntityManager 의존성 제거 및 신규/보강 노드 집계 로직 수정
GiY5ngKim added a commit that referenced this pull request Aug 5, 2026
refactor/#70 미사용 Import 제거 및 리포트 방어로직 추가
GiY5ngKim added a commit that referenced this pull request Aug 11, 2026
GiY5ngKim added a commit that referenced this pull request Aug 11, 2026
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.

2 participants