-
Notifications
You must be signed in to change notification settings - Fork 20
/
openapi.yaml
150 lines (146 loc) · 3.91 KB
/
openapi.yaml
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
---
# OpenAPI Spec for the KongAir Bookings service
openapi: 3.0.0
info:
description: KongAir Bookings service provides customers the ability to book and retrieve flight bookings on KongAir
version: 0.1.0
title: Bookings Service
servers:
- url: https://api.kong-air.com
description: KongAir API Server
paths:
/health:
get:
summary: Health check endpoint for Kubernetes
description: Endpoint that returns the service health status.
responses:
'200':
description: Service is healthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: "OK"
'500':
description: Service is unhealthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: "unhealthy"
"/bookings":
get:
tags:
- sales
summary: Get a customers current bookings
operationId: get-bookings
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Booking'
examples:
Example Bookings list response:
value: |
[{
"ticket_number": "CDF3412",
"seat": "32A",
"flight": {
"number": "KA924",
"route_id": "LHR-SFO",
"scheduled_departure": "2023-09-03T09:15:00Z",
"scheduled_arrival": "2023-09-03T14:23:00Z"
}
}]
'401':
description: Unauthorized
post:
tags:
- sales
summary: Create a new customer booking
operationId: post-booking
responses:
'201':
description: Booking Created Successfully
content:
application/json:
schema:
$ref: '#/components/schemas/BookingResponse'
examples:
Example new booking response body:
value: |
{
"ticket_number": "CDF3412"
}
'401':
description: Unauthorized
'404':
description: Not Found, likely for the flight_number given
content:
text/plain:
schema:
type: string
example: Not found
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BookingRequest'
examples:
Example new booking request body:
value: |
{
"flight_number": "KA924",
"seat": "32A"
}
components:
schemas:
Booking:
type: object
properties:
ticket_number:
type: string
flight:
type: object
properties:
number:
type: string
route_id:
type: string
scheduled_departure:
type: string
format: date-time
scheduled_arrival:
type: string
format: date-time
seat:
type: string
required:
- ticket_number
- flight
BookingRequest:
type: object
properties:
flight_number:
type: string
seat:
type: string
required:
- flight_number
BookingResponse:
type: object
properties:
ticket_number:
type: string
required:
- ticket_number