-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
152 lines (152 loc) · 3.58 KB
/
Copy pathopenapi.yaml
File metadata and controls
152 lines (152 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
openapi: 3.1.0
info:
title: ForumAPI
version: 1.0.0
description: RESTful API for forum application (final submission Dicoding Javascript Backend Expert)
servers:
- url: http://localhost:5000
description: Local
- url: https://www.easy-taxis-build-brightly.a276.dcdg.xyz/
description: Submission server
paths:
/users:
post:
summary: Register a new user
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [username, password, fullname]
properties:
username:
type: string
password:
type: string
fullname:
type: string
responses:
'201':
description: User created
'400':
description: Invalid input
/authentications:
post:
summary: Login user
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [username, password]
properties:
username:
type: string
password:
type: string
responses:
'200':
description: Login success
'401':
description: Unauthorized
/threads:
post:
summary: Create a new thread
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [title, body]
properties:
title:
type: string
body:
type: string
responses:
'201':
description: Thread created
'400':
description: Invalid input
'401':
description: Unauthorized
get:
summary: Get all threads
responses:
'200':
description: List of threads
/threads/{threadId}:
get:
summary: Get thread detail
parameters:
- name: threadId
in: path
required: true
schema:
type: string
responses:
'200':
description: Thread detail
'404':
description: Thread not found
put:
summary: Update a thread
security:
- bearerAuth: []
parameters:
- name: threadId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- title
- body
properties:
title:
type: string
body:
type: string
responses:
'200':
description: Thread updated
'400':
description: Invalid input
'401':
description: Unauthorized
'404':
description: Thread not found
delete:
summary: Delete a thread
security:
- bearerAuth: []
parameters:
- name: threadId
in: path
required: true
schema:
type: string
responses:
'200':
description: Thread deleted
'401':
description: Unauthorized
'404':
description: Thread not found
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT