docs: Swagger 공통 에러 응답(ErrorResponse) 문서화 - #216
Merged
Conversation
성공 응답의 실제 타입(ApiResponse<T>)과 요청 DTO는 springdoc이 이미 정확히 추론하지만, 예외 핸들러가 던지는 ErrorResponse는 컨트롤러 시그니처에 드러나지 않아 문서에서 빠져 있었다. OpenApiConfig에서 ErrorResponse 스키마를 명시적으로 등록하고 OperationCustomizer로 모든 오퍼레이션에 4XX/5XX 공통 에러 응답을 전역으로 붙인다. Closes #215
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by step-3.7-flash · Input: 49.7K · Output: 11.8K · Cached: 269.2K |
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.
변경 내용
OpenApiConfig에 공통 에러 응답(global.error.ErrorResponse) 스키마를 명시적으로 등록 (ErrorResponse/FieldErrorDetail)GlobalExceptionHandler)가 던지는 응답이라 컨트롤러 반환 타입만으로는 springdoc이 알 수 없어서ModelConverters로 수동 등록OperationCustomizer빈을 추가해 전체 오퍼레이션에4XX/5XX공통 에러 응답을 전역으로 부여ApiResponse<T>제네릭)과 요청 DTO(Bean Validation 포함)는 docs: Swagger(OpenAPI) API 문서 도입 #213 에서 확인한 대로 springdoc이 컨트롤러 시그니처에서 이미 정확히 추론하고 있어 별도 작업이 필요 없었음검증
./gradlew spotlessApply→./gradlew compileJava→./gradlew test spotlessCheck모두 통과/v3/api-docs: 전체 61개 오퍼레이션 모두에200/4XX/5XX응답 존재ErrorResponse,FieldErrorDetail스키마가components.schemas에 정상 등록됨4XX/5XX응답이ErrorResponse스키마를 올바르게 참조함연결 이슈
Closes #215