Newer
Older
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
openapi: 3.0.1
info:
title: Airport Manager
description: |
Microservice Application for Airport Manager
contact:
name: Martin Slovik
email: 540485@mail.muni.cz
# insert your information as well
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: "1.1"
servers:
- url: "{scheme}://{server}:{port}"
description: my server
variables:
scheme:
default: http
enum:
- http
- https
server:
default: localhost
port:
default: "8080"
tags:
- name: Core
description: microservice for core
paths:
/api/stewards:
get:
tags:
- Steward
summary: Get all stewards
description: |
Returns an array of objects representing stewards, ordered from the newest to the oldest.
Each steward must have an **id**, **firstName** and **lastName**.
operationId: getAllStewards
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/StewardDto'

Martin Slovík
committed
post:
tags:
- Steward
summary: Create a new steward
description: |
Receives data both in request body and as URL parameter and stores them as a new steward.
Returns the new steward as response.
operationId: createSteward
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/NewStewardDtoRequest'
required: true
responses:
"201":
$ref: '#/components/responses/SingleStewardDtoResponse'
"400":
description: input data were not correct
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/api/stewards/{id}:
get:
tags:
- Steward

Martin Slovík
committed
summary: Get steward by id
description: Looks up a stewards by id.
operationId: getSteward
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
$ref: '#/components/responses/SingleStewardDtoResponse'
"404":
description: steward not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'

Martin Slovík
committed
delete:
tags:
- Steward
summary: Delete steward by id
operationId: deleteSteward
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"204":
description: deleted
"404":
description: steward not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
'401':
description: unauthorized
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
/api/stewards/paged:
get:
tags:
- Steward
summary: Paged stewards
description: |
Returns a page of stewards. Stewards are ordered from the newest to the oldest.
The parameter `page` specifies zero-based index of the requested page,
and the parameter `size` specifies the size of the page.
operationId: getStewardsPaged
parameters:
- name: page
in: query
description: Zero-based page index (0..N)
required: false
schema:
minimum: 0
type: integer
default: 0
- name: size
in: query
description: The size of the page to be returned
required: false
schema:
minimum: 1
type: integer
default: 20
- name: sort
in: query
description: "Sorting criteria in the format: property,(asc|desc). Default\
\ sort order is ascending. Multiple sort criteria are supported."
required: false
schema:
type: array
items:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PageStewardDto'
/api/flights:
get:
tags:
- Flight
summary: Get all flights
description: |
Returns an array of objects representing flights, ordered from the newest to the oldest.
Each steward must have an **id**.
operationId: getAllFlights
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/FlightDto'
components:
schemas:
DomainEntity:
title: domain entity
description: represents a domain entity
type: object
required:
- id
properties:
id:
type: integer
description: id of domain entity
format: int64
example: 1
discriminator:
propertyName: objectType
ErrorMessage:
allOf:
- $ref: '#/components/schemas/DomainEntity'
title: error message
description: response body for HTML statuses
type: object
properties:
timestamp:
type: string
description: time in ISO format
format: date-time
example: 2022-12-21T18:52:10.757Z
status:
type: integer
description: HTTP status code
format: int32
example: 404
error:
type: string
description: HTTP status text
example: Not Found
message:
type: string
description: reason for error
example: entity not found
path:
type: string
description: URL path
example: /api/stewards/1
StewardDto:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: steward
description: represents a steward on a flight
required:
- id
- firstName
- lastName
properties:
firstName:
type: string
description: first name of a steward
example: John
lastName:
type: string
description: last name of a steward
example: Doe

Martin Slovík
committed
flights:
type: array
description: flights assigned to a steward
items:
$ref: '#/components/schemas/FlightDto'
NewStewardDtoRequest:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: steward
required:
- id
- firstName
- lastName
properties:
firstName:
type: string
description: first name of a steward
example: John
lastName:
type: string
description: last name of a steward
example: Doe
description: |
object for requesting new steward
FlightDto:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: flight
description: represents a flight
required:
- id

Martin Slovík
committed
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
- departureTime
- arrivalTime
- stewards
- airplane
properties:
departureTime:
type: string
description: time of flight departure
format: date-time
example: 2022-12-22T12:04:04.493908908+01:00
arrivalTime:
type: string
description: time of flight arrival
format: date-time
example: 2022-12-22T12:04:04.493908908+01:00
stewards:
type: array
description: stewards assigned to a flight
items:
$ref: '#/components/schemas/StewardDto'
airplane:
$ref: '#/components/schemas/AirplaneDto'
AirplaneTypeDto:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: airplane type
description: represents airplane type
required:
- id
- name
properties:
name:
type: string
description: airplane type name
example: Boeing 747, Airbus A380, ...
AirplaneDto:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: airplane
description: represents airplane
required:
- id
- name
- capacity
- type
properties:
name:
type: string
description: airplane name
example: Spitfire, Messerschmidt, ...
capacity:
type: integer
description: airplane seat capacity
format: int32
example: 150
type:
$ref: '#/components/schemas/AirplaneTypeDto'
PageableObject:
type: object

Martin Slovík
committed
title: pageable object
properties:
offset:
type: integer
format: int64
sort:
$ref: '#/components/schemas/SortObject'
pageSize:
type: integer
format: int32
pageNumber:
type: integer
format: int32
paged:
type: boolean
unpaged:
type: boolean
SortObject:
type: object

Martin Slovík
committed
title: sort object
properties:
empty:
type: boolean
sorted:
type: boolean
unsorted:
type: boolean
PageStewardDto:
type: object

Martin Slovík
committed
title: paged stewards
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
properties:
totalPages:
type: integer
format: int32
totalElements:
type: integer
format: int64
first:
type: boolean
last:
type: boolean
size:
type: integer
format: int32
content:
type: array
items:
$ref: '#/components/schemas/StewardDto'
number:
type: integer
format: int32
sort:
$ref: '#/components/schemas/SortObject'
numberOfElements:
type: integer
format: int32
pageable:
$ref: '#/components/schemas/PageableObject'
empty:
type: boolean
responses:
SingleStewardDtoResponse:
description: response containing a single steward
content:
application/json:
schema:
$ref: '#/components/schemas/StewardDto'
links:
link_to_getSteward:
operationId: getSteward
parameters:
id: $response.body#/id
description: |
The `id` value returned in the response can be used as
the `id` parameter in `GET /stewards/{id}`.