Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public record GraduationUserSummaryPageResponse<T>(
+ "\"name\": \"홍길동\", "
+ "\"graduationDate\": \"2028-08\", "
+ "\"graduationType\": \"자격증\", "
+ "\"advisor\": \"김교수\","
+ "\"status\": {"
+ "\"type\": \"CERTIFICATE\", "
+ "\"submitted\": true, "
Expand All @@ -27,6 +28,7 @@ public record GraduationUserSummaryPageResponse<T>(
+ "\"name\": \"김철수\", "
+ "\"graduationDate\": \"2028-08\", "
+ "\"graduationType\": \"논문\", "
+ "\"advisor\": \"이순신\","
+ "\"status\": {"
+ "\"type\": \"THESIS\", "
+ "\"midThesis\": {\"submitted\": true, \"approval\": true}, "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public record GraduationUserSummaryResponse(
@Schema(description = "졸업 유형", example = "자격증", requiredMode = REQUIRED)
String graduationType,

@Schema(description = "지도교수", example = "김교수", requiredMode = REQUIRED)
String advisor,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -type f -name "GraduationUserSummaryResponse.java" | head -5

Repository: kgu-developers/aics-server

Length of output: 189


🏁 Script executed:

find . -type f -name "GraduationUser.java" | grep -E "(entity|domain)" | head -5

Repository: kgu-developers/aics-server

Length of output: 161


🏁 Script executed:

rg -n "class GraduationUserSummaryResponse" -A 80 --type=java

Repository: kgu-developers/aics-server

Length of output: 52


🏁 Script executed:

cat -n ./aics-admin/src/main/java/kgu/developers/admin/graduationUser/presentation/response/GraduationUserSummaryResponse.java

Repository: kgu-developers/aics-server

Length of output: 3100


🏁 Script executed:

cat -n ./aics-domain/src/main/java/kgu/developers/domain/graduationUser/domain/GraduationUser.java

Repository: kgu-developers/aics-server

Length of output: 2605


advisor REQUIRED인데 null 가능성으로 인한 스키마 계약 위반

advisorProfessor는 null 제약이 없는 순수 String 필드인데, 스키마는 requiredMode = REQUIRED로 선언되어 있습니다. 따라서 advisorProfessor가 null이면 API 응답이 REQUIRED 계약을 위반합니다.

다음 중 하나로 정리해주세요:

  1. DB/도메인 레벨에서 advisorProfessor에 @NotNull 또는 NOT NULL 제약 추가
  2. null-safe 기본값 처리 (라인 63의 graduationType처럼)
  3. requiredMode를 완화 (NOT_REQUIRED 또는 제거)
✅ null-safe 기본값 예시 (권장)
-            .advisor(graduationUser.getAdvisorProfessor())
+            .advisor(graduationUser.getAdvisorProfessor() != null
+                ? graduationUser.getAdvisorProfessor()
+                : "미정")
🤖 Prompt for AI Agents
In
`@aics-admin/src/main/java/kgu/developers/admin/graduationUser/presentation/response/GraduationUserSummaryResponse.java`
around lines 30 - 31, The response field advisor in
GraduationUserSummaryResponse is marked required but populated from a nullable
advisorProfessor, causing a schema contract violation; fix by making the mapping
null-safe (preferred): ensure the DTO sets advisor = advisorProfessor != null ?
advisorProfessor : "정보 없음" (or another sensible default) when constructing
GraduationUserSummaryResponse (or via its builder/constructor), alternatively
add `@NotNull/NOT` NULL to the domain field advisorProfessor or change the
`@Schema`(requiredMode) to NOT_REQUIRED — pick one of these and apply consistently
so advisor never violates the declared required contract.


@Schema(
description = "졸업 요건 제출 및 승인 상태 (자격증 또는 논문)",
example = "{"
Expand Down Expand Up @@ -59,6 +62,7 @@ public static GraduationUserSummaryResponse of(
.graduationDate(graduationUser.getGraduationDate().format(formatter))
.graduationType(graduationUser.getGraduationType() != null ? graduationUser.getGraduationType().getDescription() : "미정")
.status(status)
.advisor(graduationUser.getAdvisorProfessor())
.build();
}
}