Skip to content

[fix] Swagger 성공 응답에 error 필드가 노출되는 문제 수정 - #21

Merged
kyer5 merged 1 commit into
developfrom
chore/swagger-success-error-field
Aug 12, 2026
Merged

[fix] Swagger 성공 응답에 error 필드가 노출되는 문제 수정#21
kyer5 merged 1 commit into
developfrom
chore/swagger-success-error-field

Conversation

@kyer5

@kyer5 kyer5 commented Aug 12, 2026

Copy link
Copy Markdown
Member

📌 개요 (why, what)

  • Swagger 문서에서 성공 응답에도 error 필드가 노출되는 문제 수정

🛠️ 구현 방법 (how)

  • springdoc은 컨트롤러 반환 타입(ApiResponse<T>)을 정적으로 리플렉션해 스키마를 생성하므로, @JsonInclude(NON_NULL)과 무관하게 error 필드가 모든 성공 응답 스키마에 노출되고 있었음
  • error 필드에 @Schema(hidden = true)를 적용해 문서에서만 제외 (런타임 JSON 직렬화는 그대로 유지)
  • status 필드가 예시 값 없이 0으로 표시되던 것도 @Schema(example = "200")으로 수정

🤔 검토한 대안과 선택 이유 (trade-off)

대안 장점 단점 선택 여부
error 필드에 @Schema(hidden = true) 영향 범위 최소 (1개 파일), 응답 계약 변경 없음 에러 응답 구조가 Swagger 문서에 노출되지 않음

💭 리뷰 포인트


📚 Reference (Optional)

@kyer5
kyer5 requested a review from gihhyeon August 12, 2026 14:25
@kyer5 kyer5 self-assigned this Aug 12, 2026
@kyer5 kyer5 added 🐛 bug 버그 이슈 ⚙️ chore 설정 및 기타 이슈 labels Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kyer5, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7aeded11-2a46-407d-a0bf-1da0cd636e9e

📥 Commits

Reviewing files that changed from the base of the PR and between 1e3683b and 47cad1e.

📒 Files selected for processing (1)
  • src/main/java/com/nexters/death/global/payload/ApiResponse.java

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.

@gihhyeon gihhyeon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM~~!
제목 태그 chore 말고 fix는 어떠신가여

@kyer5
kyer5 merged commit 38bb5ef into develop Aug 12, 2026
2 checks passed
@kyer5
kyer5 deleted the chore/swagger-success-error-field branch August 12, 2026 23:51
@kyer5 kyer5 changed the title [chore] Swagger 성공 응답에 error 필드가 노출되는 문제 수정 [fix] Swagger 성공 응답에 error 필드가 노출되는 문제 수정 Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug 버그 이슈 ⚙️ chore 설정 및 기타 이슈

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[chore] Swagger 성공 응답 예시에 error 필드가 함께 노출되는 문제 수정

2 participants