Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -5,6 +5,7 @@
import com.semosan.api.domain.mountain.enums.Difficulty;
import com.semosan.api.domain.mountain.enums.TransportationType;
import com.semosan.api.domain.review.entity.Review;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -45,6 +46,7 @@ public static MountainInfo from(Mountain mountain) {
}
}

@Schema(name = "MountainDetailCourseInfo")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

[P3] Springdoc 전역 설정을 통한 스키마 이름 충돌 해결 제안

문제점:
현재는 CourseInfo와 같이 동일한 이름을 가진 내부 클래스(record)의 스키마 충돌을 방지하기 위해 각 DTO마다 @Schema(name = "...") 어노테이션을 수동으로 추가하고 있습니다. 이 방식은 새로운 DTO가 추가될 때마다 충돌을 수동으로 감지하고 어노테이션을 누락 없이 작성해야 하므로 유지보수성이 떨어집니다.

해결 방안:
application.yml (또는 application.properties) 설정에 아래 옵션을 추가하면, Springdoc이 자동으로 정규화된 클래스 이름(Fully Qualified Class Name)을 사용하여 스키마를 생성하므로 어노테이션 없이도 충돌을 전역적으로 방지할 수 있습니다.

springdoc:
  use-fully-qualified-model-names: true

이 설정을 적용하면 현재 추가된 @Schema(name = "MountainDetailCourseInfo")@Schema(name = "NearbyMountainCourseInfo") 어노테이션을 제거할 수 있어 코드가 더 깔끔해집니다.

public record CourseInfo(
Long courseId,
String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.semosan.api.domain.mountain.entity.Course;
import com.semosan.api.domain.mountain.entity.Mountain;
import com.semosan.api.domain.mountain.enums.Difficulty;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.List;

Expand Down Expand Up @@ -44,6 +45,7 @@ public static NearbyMountainInfo from(Mountain mountain) {
* 시안의 코스 카드에 표시되는 정보 중 현재 도메인 모델로 채울 수 있는 것만 포함.
* TODO: ascent / descent / maxAltitude 컬럼이 Course 에 추가되면 함께 노출.
*/
@Schema(name = "NearbyMountainCourseInfo")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

[P2] 이미 추가된 Course 엔티티 필드 반영 및 TODO 제거 제안

문제점:
주석에 TODO: ascent / descent / maxAltitude 컬럼이 Course 에 추가되면 함께 노출이라고 명시되어 있으나, 현재 Course 엔티티에는 이미 ascent, descent, maxAltitude 필드가 구현되어 있습니다.

해결 방안:
해당 필드들을 NearbyMountainResponse.CourseInfo DTO에 추가하여 프론트엔드에 노출하고, 아웃데이트된 TODO 주석을 제거하거나 업데이트하는 것이 좋습니다.

동일하게 MountainDetailResponse.CourseInfo에도 해당 필드들을 추가하는 것을 검토해 주세요.

public record CourseInfo(
Long courseId,
String name,
Expand Down