Skip to content

Commit d89887b

Browse files
authored
API 응답 스키마 수정, Comment와 Ticket 공통 스키마 추가 (#15)
`components/schemas` 섹션에 Comment와 Ticket 스키마를 추가. API 응답 스키마에서 해당 Comment와 Ticket 스키마를 사용하도록 수정. Tickets API 설명 개선.
1 parent 8b6ccd9 commit d89887b

File tree

1 file changed

+47
-42
lines changed

1 file changed

+47
-42
lines changed

tickets/openapi.yaml

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
openapi: 3.0.1
22
info:
33
title: Tickets API
4-
description: ""
4+
description: |
5+
티켓 관리 시스템을 위한 RESTful API입니다.
6+
이 API를 통해 티켓을 생성, 조회, 수정, 삭제하고 댓글을 관리할 수 있습니다.
7+
8+
각 티켓은 고유 ID, 제목, 설명, 상태를 가지며 여러 댓글을 포함할 수 있습니다.
9+
티켓 상태는 open, closed 등으로 관리됩니다.
510
version: 1.0.0
611
tags:
712
- name: tickets api
@@ -26,32 +31,7 @@ paths:
2631
type: array
2732
description: 티켓 목록
2833
items:
29-
type: object
30-
properties:
31-
id:
32-
type: string
33-
description: 티켓 ID
34-
title:
35-
type: string
36-
description: 티켓 제목
37-
description:
38-
type: string
39-
description: 티켓 내용
40-
status:
41-
type: string
42-
description: 티켓 상태
43-
comments:
44-
type: array
45-
description: 댓글 목록
46-
items:
47-
type: object
48-
properties:
49-
id:
50-
type: string
51-
description: 댓글 ID
52-
content:
53-
type: string
54-
description: 댓글 내용
34+
$ref: "#/components/schemas/Ticket"
5535
example:
5636
tickets:
5737
- id: 01JQA8YHB2WQ5GTDWDKWK744B9
@@ -104,8 +84,7 @@ paths:
10484
content:
10585
application/json:
10686
schema:
107-
type: object
108-
properties: {}
87+
$ref: "#/components/schemas/Ticket"
10988
example:
11089
id: 01JQX1FTS2KJFQRFEWVEM83QH2
11190
title: New Ticket
@@ -135,8 +114,7 @@ paths:
135114
content:
136115
application/json:
137116
schema:
138-
type: object
139-
properties: {}
117+
$ref: "#/components/schemas/Ticket"
140118
example:
141119
id: 01JQA8YHB2WQ5GTDWDKWK744B9
142120
title: Some Ticket
@@ -178,8 +156,7 @@ paths:
178156
content:
179157
application/json:
180158
schema:
181-
type: object
182-
properties: {}
159+
$ref: "#/components/schemas/Ticket"
183160
example:
184161
id: 01JQA8YHB2WQ5GTDWDKWK744B9
185162
title: Some Ticket
@@ -208,8 +185,7 @@ paths:
208185
content:
209186
application/json:
210187
schema:
211-
type: object
212-
properties: {}
188+
$ref: "#/components/schemas/Ticket"
213189
example:
214190
id: 01JQX1FTS2KJFQRFEWVEM83QH2
215191
title: Some Ticket
@@ -251,8 +227,9 @@ paths:
251227
content:
252228
application/json:
253229
schema:
254-
type: object
255-
properties: {}
230+
type: array
231+
items:
232+
$ref: "#/components/schemas/Comment"
256233
example:
257234
- id: 01JQFRVCZ36PC7C3CDYWGGGVH2
258235
content: This is the first comment.
@@ -291,8 +268,7 @@ paths:
291268
content:
292269
application/json:
293270
schema:
294-
type: object
295-
properties: {}
271+
$ref: "#/components/schemas/Comment"
296272
example:
297273
id: 01JQX26V9XH60Y98S7Z1J87EYR
298274
content: This is the first comment.
@@ -326,15 +302,44 @@ paths:
326302
content:
327303
application/json:
328304
schema:
329-
type: object
330-
properties: {}
305+
$ref: "#/components/schemas/Comment"
331306
example:
332307
id: 01JQX26V9XH60Y98S7Z1J87EYR
333308
content: This is the first comment.
334309
headers: {}
335310
security: []
336311
components:
337-
schemas: {}
312+
schemas:
313+
Comment:
314+
type: object
315+
properties:
316+
id:
317+
type: string
318+
description: 댓글 ID
319+
content:
320+
type: string
321+
description: 댓글 내용
322+
323+
Ticket:
324+
type: object
325+
properties:
326+
id:
327+
type: string
328+
description: 티켓 ID
329+
title:
330+
type: string
331+
description: 티켓 제목
332+
description:
333+
type: string
334+
description: 티켓 내용
335+
status:
336+
type: string
337+
description: 티켓 상태
338+
comments:
339+
type: array
340+
description: 댓글 목록
341+
items:
342+
$ref: "#/components/schemas/Comment"
338343
securitySchemes: {}
339344
servers:
340345
- url: https://tickets-api.codedemo.co

0 commit comments

Comments
 (0)