-
Notifications
You must be signed in to change notification settings - Fork 0
/
oas-restaurant-booking.yaml
155 lines (155 loc) · 5.05 KB
/
oas-restaurant-booking.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
151
152
153
154
155
openapi: 3.0.1
info:
title: "Restaurant booking"
description: "API for booking a table in the restaurant"
version: 1.0.0
servers:
- url: #[system api endpoint]
paths:
/booking:
post:
description: "Create a new restaurant booking"
requestBody:
description: "Details of the booking request"
required: true
content:
application/json:
schema:
type: object
properties:
date:
type: string
format: date
description: "The date of the booking"
name:
type: string
description: "Name to identify your reservation"
hour:
type: string
format: time
description: "The hour of the booking"
num_guests:
type: string
description: "The number of guests for the booking"
required:
- date
- name
- hour
- num_guests
example:
date: "2025-11-03"
name: "Duoh"
hour: "10:00"
num_guests: "5"
responses:
"200":
description: "Successfully book a restaurant table in the system"
content:
application/json:
schema:
type: object
properties:
Message:
type: string
description: "Success message with the booking ID that has been created"
example:
Message: "Success! Your booking on 2025-11-03 at 10:00 by Duoh is confirmed. Your booking ID is 7f0bdd0c."
"404":
description: "Unable to book a restaurant table in the system"
content:
application/json:
schema:
type: object
properties:
Error:
type: string
description: "Missing required parameters"
example:
Error: "Missing required booking inforamtion"
/booking/{id}:
get:
description: "Retrieve details of a restaurant booking"
parameters:
- name: "id"
in: "path"
description: "The ID of the booking to retrieve"
required: true
schema:
type: "string"
responses:
"200":
description: "A JSON object containing the booking detail"
content:
application/json:
schema:
type: object
properties:
booking_id:
type: string
description: "The ID of the booking to retrieve"
name:
type: string
description: "Name to identify your reservation"
date:
type: string
format: date
description: "The date of the booking"
hour:
type: string
format: time
description: "The hour of the booking"
num_guests:
type: string
description: "The number of guests for the booking"
example:
booking_id: "7f0bdd0c"
name: "Duoh"
date: "2025-11-03"
hour: "10:00"
num_guests: "5"
"404":
description: "Booking ID not found"
content:
application/json:
schema:
type: object
properties:
Error:
type: string
description: "Error message indicating booking ID not found"
example:
Error: "No booking ID 7f0bdd0c found"
delete:
description: "Delete (cancel) an existing restaurant booking"
parameters:
- name: "id"
in: "path"
description: "The ID of the booking to be deleted"
required: true
schema:
type: "string"
responses:
"200":
description: "Cancel an existing restaurant booking successfully"
content:
application/json:
schema:
type: object
properties:
Message:
type: string
description: "Success message with the booking ID that was deleted"
example:
Message: "Booking ID 7f0bdd0c was deleted successfully"
"404":
description: "Booking ID not found"
content:
application/json:
schema:
type: object
properties:
Error:
type: string
description: "Error message indicating booking ID not found"
example:
Error: "No booking ID 7f0bdd0c found"