generated from pricelees/issue-pr-template
feat: Swagger 문서화에만 사용되는 별도의 형식 정의
- 코틀린 제네릭 타입이 자바처럼 호환되지 않아 별도로 정의
This commit is contained in:
parent
0679365803
commit
429fc59fca
@ -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