generated from pricelees/issue-pr-template
[#7] API 응답 형식 재정의 및 Swagger-UI 관련 코드 패키지 분리 #8
@ -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>
|
||||
Loading…
x
Reference in New Issue
Block a user