Skip to content
Merged
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
20 changes: 18 additions & 2 deletions src/lib/openapi/register-paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ import {
const ErrorMessageSchema = z.string()
const NoContentResponse = { description: '성공적으로 처리되었습니다.' }

const RecruitmentImageUploadRequestSchema = z
.object({
file: z.string().openapi({
type: 'string',
format: 'binary',
description: '업로드할 모집공고 이미지 파일',
}),
})
.openapi('RecruitmentImageUploadRequest')

const RecruitmentImageUploadResponseSchema = z
.object({
url: z.string(),
})
.openapi('RecruitmentImageUploadResponse')

const validationErrorResponse = {
description: '잘못된 요청입니다.',
content: {
Expand Down Expand Up @@ -1562,7 +1578,7 @@ registry.registerPath({
body: {
content: {
'multipart/form-data': {
schema: z.object({ file: z.instanceof(File) }).openapi('RecruitmentImageUploadRequest'),
schema: RecruitmentImageUploadRequestSchema,
},
},
},
Expand All @@ -1572,7 +1588,7 @@ registry.registerPath({
description: '업로드 성공',
content: {
'application/json': {
schema: z.object({ url: z.string() }).openapi('RecruitmentImageUploadResponse'),
schema: RecruitmentImageUploadResponseSchema,
example: {
url: 'https://cdn.all-clear.cc/club%2Fxxxx-xxxx-xxxx.png',
},
Expand Down
Loading