-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathopenapi.json
258 lines (256 loc) · 9.31 KB
/
openapi.json
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
{
"openapi": "3.0.2",
"info": {
"title": "Incident",
"version": "1.0.1"
},
"paths": {
"/incidents": {
"summary": "Path used to manage the list of Incidents.",
"description": "The REST endpoint/path used to list and create zero or more `Incident` entities. This path contains a `GET` and `POST` operation to perform the list and create tasks, respectively.",
"get": {
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Incident"
}
}
}
},
"description": "Successful response - returns an array of `Incident` entities."
}
},
"operationId": "getIncidents",
"summary": "List All Incidents",
"description": "Gets a list of all `Incident` entities."
},
"post": {
"requestBody": {
"description": "A new `Incident` to be created.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Incident"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "Successful response."
}
},
"operationId": "createIncident",
"summary": "Create a Incident",
"description": "Creates a new instance of a `Incident`."
}
},
"/incidents/incident/{incidentId}": {
"summary": "Path used to manage a single Incident.",
"description": "The REST endpoint/path used to get, update, and delete single instances of an `Incident`. This path contains `GET`, `PUT`, and `DELETE` operations used to perform the get, update, and delete tasks, respectively.",
"get": {
"parameters": [
{
"name": "incidentId",
"description": "A unique identifier for a `Incident`.",
"schema": {
"type": "string"
},
"in": "path",
"required": true
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Incident"
}
}
},
"description": "Successful response - returns a single `Incident`."
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "Returns an `Error` response."
}
},
"operationId": "getIncident",
"summary": "Get a Incident",
"description": "Gets the details of a single instance of a `Incident`."
},
"parameters": [
{
"name": "incidentId",
"description": "A unique identifier for a `Incident`.",
"schema": {
"type": "string"
},
"in": "path",
"required": true
}
]
},
"/incidents/{status}": {
"get": {
"parameters": [
{
"name": "status",
"description": "Status to be searched",
"schema": {
"type": "string"
},
"in": "path",
"required": true
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Incident"
}
}
}
},
"description": "A list of incidents with the given status."
}
},
"operationId": "getIncidentByStatus",
"summary": "Get an incident by status",
"description": "Get all incidents by a status."
}
},
"/incidents/victim/byname/{name}": {
"get": {
"parameters": [
{
"name": "name",
"description": "Name to be searched",
"schema": {
"type": "string"
},
"in": "path",
"required": true
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Incident"
}
}
}
},
"description": "Victim's name"
}
},
"operationId": "getIncidentsByVictimName",
"summary": "Get incidents by victim name.",
"description": "Get all incidents for a victim."
}
},
"/reset": {
"post": {
"responses": {
"200": {
"description": "Reset done."
}
},
"operationId": "reset",
"summary": "Reset the incident database.",
"description": "Delete all incidents from the database."
}
}
},
"components": {
"schemas": {
"Incident": {
"required": [
"latitude",
"longitude",
"numberOfPeople",
"medicalNeeded",
"victimName",
"victimPhoneNumber",
"incidentId",
"reportedTime",
"version"
],
"type": "object",
"properties": {
"numberOfPeople": {
"type": "integer"
},
"victimName": {
"description": "Victim's full name",
"type": "string"
},
"victimPhoneNumber": {
"type": "string"
},
"status": {
"enum": [
"REQUESTED",
"ASSIGNED",
"COMPLETED"
]
},
"incidentId": {
"type": "string"
},
"medicalNeeded": {
"type": "boolean"
},
"latitude": {
"type": "string"
},
"longitude": {
"type": "string"
},
"reportedTime": {
"type": "integer"
},
"version": {
"description": "",
"type": "integer"
}
}
},
"Error": {
"required": [
"code",
"message"
],
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
}
}
}
}
}
}