Enhances API documentation and enables Swagger UI

Adds detailed `@ApiBody` schemas to several endpoints within `PageController` and `SpaceController`, including methods for creating and updating pages, spaces, and managing temporary access tokens. This provides clear, machine-readable descriptions of expected request bodies for API consumers.

Enables the Swagger UI in the main application bootstrap, allowing for interactive exploration and testing of the API endpoints directly through the browser.
This commit is contained in:
dahyeon committed 2025-11-10 16:29:42 +00:00
1 parent bb992167d2
commit 4ec9bf1acf
3 files changed
+171 -1

No files matched your search

+47
View File
@@ -5,6 +5,7 @@ import {
ApiResponse,
ApiParam,
ApiQuery,
ApiBody,
ApiBadRequestResponse,
ApiNotFoundResponse,
ApiConflictResponse,
@@ -40,6 +41,33 @@ export class SpaceController {
summary: '스페이스 생성',
description: '새로운 스페이스를 생성합니다. 스페이스 키는 고유해야 하며 URL에 사용됩니다. (인증 필요)'
})
@ApiBody({
description: '스페이스 생성 정보 (userId는 토큰에서 자동 추출)',
schema: {
type: 'object',
required: ['spaceKey', 'name'],
properties: {
spaceKey: {
type: 'string',
description: '스페이스 키 (고유 식별자, URL에 사용, 소문자/숫자/하이픈만 허용)',
pattern: '^[a-z0-9-]+$',
maxLength: 50,
example: 'engineering'
},
name: {
type: 'string',
description: '스페이스 이름',
maxLength: 255,
example: 'Engineering Team'
},
description: {
type: 'string',
description: '스페이스 설명',
example: 'Engineering team documentation and knowledge base'
}
}
}
})
@ApiResponse({
status: 201,
description: '스페이스가 성공적으로 생성됨',
@@ -223,6 +251,25 @@ export class SpaceController {
type: String,
format: 'uuid'
})
@ApiBody({
description: '스페이스 업데이트 정보 (모든 필드 선택사항)',
schema: {
type: 'object',
properties: {
name: {
type: 'string',
description: '스페이스 이름',
maxLength: 255,
example: 'Updated Team Name'
},
description: {
type: 'string',
description: '스페이스 설명',
example: 'Updated description for the team'
}
}
}
})
@ApiResponse({
status: 200,
description: '스페이스가 성공적으로 업데이트됨',