[#7] API 응답 형식 재정의 및 Swagger-UI 관련 코드 패키지 분리 #8

Merged
pricelees merged 16 commits from refactor/#7 into main 2025-07-15 05:37:42 +00:00
Showing only changes of commit 429fc59fca - Show all commits

View File

@ -0,0 +1,24 @@
package roomescape.common.docs
import io.swagger.v3.oas.annotations.media.Schema
import roomescape.common.exception.ErrorType
/**
* Swagger API 문서의 Content에서만 사용되는 스펙
*/
@Schema(name = "API 에러 응답")
data class ErrorResponseSpec(
val errorType: ErrorType,
val message: String? = errorType.description
)
@Schema(name = "API 성공 응답")
interface ResponseSpec<T> {
val data: T
}
@Schema(name = "데이터가 없는 API 성공 응답")
data class EmptyResponseSpec(
override val data: Unit = Unit
) : ResponseSpec<Unit>