-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yml
205 lines (205 loc) · 4.63 KB
/
swagger.yml
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
consumes:
- application/json
info:
description: Kyruus Doctor Appointments
title: Kyruus
version: 0.1.0
produces:
- application/json
schemes:
- http
swagger: "2.0"
paths:
/doctors:
post:
operationId: "CreateDoctor"
parameters:
- in: body
name: CreateDoctorInput
required: true
schema:
$ref: "#/definitions/Doctor"
responses:
200:
description: "OK"
409:
description: "Doctor with id already exists"
schema:
$ref: "#/definitions/BadRequest"
/doctors/{doctorId}:
get:
operationId: "GetDoctor"
parameters:
- in: path
name: doctorId
required: true
type: integer
responses:
200:
description: "OK"
schema:
$ref: "#/definitions/Doctor"
404:
description: "Doctor not found"
schema:
$ref: "#/definitions/BadRequest"
put:
operationId: "UpdateDoctor"
parameters:
- in: path
name: doctorId
required: true
type: integer
- in: body
name: UpdateDoctorInput
required: true
schema:
$ref: "#/definitions/Doctor"
responses:
200:
description: "OK"
404:
description: "Doctor does not exists"
schema:
$ref: "#/definitions/BadRequest"
delete:
operationId: "DeleteDoctor"
parameters:
- in: path
name: doctorId
required: true
type: integer
responses:
200:
description: "OK"
404:
description: "Doctor does not exists"
schema:
$ref: "#/definitions/BadRequest"
/appointments:
post:
operationId: "CreateAppointment"
parameters:
- in: body
name: CreateAppointment
required: true
schema:
$ref: "#/definitions/Appointment"
responses:
200:
description: "OK"
409:
description: "Appointment could not be created"
schema:
$ref: "#/definitions/BadRequest"
delete:
operationId: "DeleteAppointment"
parameters:
- in: body
name: DeleteAppointment
required: true
schema:
$ref: "#/definitions/Appointment"
responses:
200:
description: "OK"
404:
description: "Appointment does not exists"
schema:
$ref: "#/definitions/BadRequest"
/appointments/{doctorId}:
get:
operationId: "GetAppointments"
parameters:
- in: path
name: doctorId
required: true
type: integer
responses:
200:
description: "OK"
schema:
type: array
items:
$ref: "#/definitions/Appointment"
404:
description: "Doctor not found"
schema:
$ref: "#/definitions/BadRequest"
definitions:
NotFound:
type: object
properties:
code:
type: integer
message:
type: string
description: "Not Found object"
BadRequest:
type: object
properties:
code:
type: integer
message:
type: string
description: "Bad Request object"
Doctor:
type: object
properties:
name:
type: string
id:
type: integer
locations:
type: array
items:
type: string
schedule:
type: array
items:
$ref: "#/definitions/Appointment"
description: "A doctor"
required:
- name
- id
- locations
- schedule
Appointment:
type: object
properties:
doctorId:
type: integer
locationId:
type: string
day:
type: string
time:
type: integer
description: "A doctor's appointment"
required:
- doctorId
- locationId
- day
- time
Time:
type: object
properties:
day:
type: string
hour:
type: integer
description: "The time value representing a doctor's appointment"
required:
- day
- hour
AppointmentList:
type: object
properties:
list:
type: array
items:
$ref: "#/definitions/Appointment"
minItems: 1
description: "A list of appointments"
required:
- list