Skip to content

docs: OpenAPI 응답 정보 추가 및 오류 응답 형식 수정#29

Merged
GoGradually merged 1 commit intomasterfrom
docs/OpenAPI-Response-정보-추가
Jan 22, 2026

Hidden character warning

The head ref may contain hidden characters: "docs/OpenAPI-Response-\uc815\ubcf4-\ucd94\uac00"
Merged

docs: OpenAPI 응답 정보 추가 및 오류 응답 형식 수정#29
GoGradually merged 1 commit intomasterfrom
docs/OpenAPI-Response-정보-추가

Conversation

@GoGradually
Copy link
Collaborator

변경된 점

  • OpenAPI에 응답 정보 스펙 추가

Copilot AI review requested due to automatic review settings January 22, 2026 20:00
@GoGradually GoGradually merged commit f691113 into master Jan 22, 2026
4 checks passed
@GoGradually GoGradually deleted the docs/OpenAPI-Response-정보-추가 branch January 22, 2026 20:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

이 PR은 Spring Boot 애플리케이션의 OpenAPI 문서화를 개선하는 작업입니다. 세 개의 컨트롤러 파일에 @ApiResponses 어노테이션을 추가하여 각 엔드포인트의 응답 스펙을 명시하고, 오류 응답 형식을 String.class에서 ErrorResponse.class로 통일했습니다.

Changes:

  • TaskControllerV1: 8개 엔드포인트에 성공/오류 응답 정보 추가
  • ScheduleControllerV1: 10개 엔드포인트에 성공/오류 응답 정보 추가 및 ArraySchema import 추가
  • MemberControllerV1: 클래스 레벨 오류 응답 형식 수정(String.class → ErrorResponse.class) 및 /now 엔드포인트 응답 정보 추가

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
TaskControllerV1.java 작업 관련 8개 엔드포인트에 @ApiResponses 추가 (생성, 수정, 조회, 완료, 되돌리기, 삭제, 일정 등록)
ScheduleControllerV1.java 일정 관련 10개 엔드포인트에 @ApiResponses 추가, List 응답을 위한 ArraySchema import 추가
MemberControllerV1.java 클래스 레벨 오류 응답 타입을 ErrorResponse.class로 변경하고 /now 엔드포인트에 200 응답 정보 추가

Comment on lines +194 to +195
@ApiResponse(responseCode = "404", description = "일정을 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "409", description = "잘못된 상태 전환입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

(1) 문제점: 일정 삭제 엔드포인트에 409 "잘못된 상태 전환입니다." 응답이 정의되어 있습니다. 삭제는 상태 전환이 아닌 리소스 제거 작업이므로 이 응답 코드가 적절하지 않을 수 있습니다.

(2) 영향: API 문서가 실제 동작과 일치하지 않을 수 있으며, 클라이언트가 잘못된 오류 처리를 구현할 수 있습니다.

(3) 수정 제안: 실제 deleteSchedule 메서드가 409 상태를 반환할 수 있는 경우가 있는지 확인하고, 그렇지 않다면 409 응답 정의를 제거해야 합니다. 참고로 작업 삭제(deleteTask) 엔드포인트는 409 응답이 없습니다.

Suggested change
@ApiResponse(responseCode = "404", description = "일정을 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "409", description = "잘못된 상태 전환입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
@ApiResponse(responseCode = "404", description = "일정을 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))

Copilot uses AI. Check for mistakes.
@GetMapping
@Operation(summary = "작업 목록 조회", description = "회원의 작업 목록을 조회합니다. page/size로 데드라인 순 페이지네이션, readyOnly로 선행 작업 없는 항목만 필터링합니다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "작업 목록 조회 성공")
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

(1) 문제점: 200 응답에 대한 content 스키마 정의가 누락되었습니다. 다른 엔드포인트들은 모두 성공 응답에 대한 스키마를 명시하고 있으나, 이 엔드포인트만 누락되어 있습니다.

(2) 영향: OpenAPI 문서에서 응답 형식이 명확하게 표시되지 않아 API 사용자가 응답 구조를 파악하기 어렵습니다.

(3) 수정 제안: Page 타입의 응답에 대한 스키마를 추가해야 합니다. 예: content = @content(schema = @Schema(implementation = Page.class))

Suggested change
@ApiResponse(responseCode = "200", description = "작업 목록 조회 성공")
@ApiResponse(responseCode = "200", description = "작업 목록 조회 성공", content = @Content(schema = @Schema(implementation = Page.class)))

Copilot uses AI. Check for mistakes.
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.

1 participant