[refactor] ApiResponse에서 에러 응답 분리 및 불필요 필드 제거 - #174
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
단일
ApiResponse<T>가data와error를 모두 가져 성공 응답 스키마에도error가 노출되던 구조를 성공/에러 전용 타입으로 분리한다. 불필요한timestamp도 제거한다.What — 무엇을 바꿨나
ApiResponse<T>: 성공 전용으로 축소 (error,timestamp필드 제거)ErrorResponse신설: 에러 전용 (data없음)GlobalExceptionHandler,JwtAuthenticationFilter가ErrorResponse반환ErrorResponse반영Why — 왜 필요한가
성공/에러를 한 타입으로 겸용해 상태코드별 스키마가 부정확했다(성공에도
error노출). 타입을 나눠 한 응답에data와error가 공존하지 않게 하고 문서를 정확히 한다.How — 어떻게 구현했나
{ status, data }/ 에러 응답:{ status, error }로 상호배타error제거는 런타임 응답 불변(NON_NULL로 이미 미노출), 스키마만 정리됨체크리스트
./gradlew test)관련 이슈
기타 / 리뷰 포인트
"data": null키 제거,timestamp제거 → 프론트 합의 완료error필드 제거는 런타임 응답 변화 없음(스키마만 정리)