1
+ {
2
+ "swagger" : " 2.0" ,
3
+ "info" : {
4
+ "description" : " Backend API for rides" ,
5
+ "version" : " 1.0.0" ,
6
+ "title" : " Rides" ,
7
+ "contact" : {
8
+ "email" : " jimenez.johnjoshua.jjj@gmail.com"
9
+ }
10
+ },
11
+ "definitions" : {
12
+ "RideOutput" : {
13
+ "type" : " object" ,
14
+ "required" : [
15
+ " startLat" ,
16
+ " startLong" ,
17
+ " endLat" ,
18
+ " endLong" ,
19
+ " riderName" ,
20
+ " driverName" ,
21
+ " driverVehicle"
22
+ ],
23
+ "properties" : {
24
+ "rideID" : {
25
+ "type" : " integer" ,
26
+ "example" : 1
27
+ },
28
+ "startLat" : {
29
+ "type" : " integer" ,
30
+ "minimum" : -90 ,
31
+ "maximum" : 90 ,
32
+ "example" : 90
33
+ },
34
+ "startLong" : {
35
+ "type" : " integer" ,
36
+ "minimum" : -180 ,
37
+ "maximum" : 180 ,
38
+ "example" : 180
39
+ },
40
+ "endLat" : {
41
+ "type" : " integer" ,
42
+ "minimum" : -90 ,
43
+ "maximum" : 90 ,
44
+ "example" : -90
45
+ },
46
+ "endLong" : {
47
+ "type" : " integer" ,
48
+ "minimum" : -180 ,
49
+ "maximum" : 180 ,
50
+ "example" : -180
51
+ },
52
+ "riderName" : {
53
+ "type" : " string" ,
54
+ "example" : " Joshua"
55
+ },
56
+ "driverName" : {
57
+ "type" : " string" ,
58
+ "example" : " John"
59
+ },
60
+ "driverVehicle" : {
61
+ "type" : " string" ,
62
+ "example" : " Truck"
63
+ },
64
+ "created" : {
65
+ "type" : " string" ,
66
+ "example" : " 2020-10-27 13:23:33"
67
+ }
68
+ }
69
+ },
70
+ "RideInput" : {
71
+ "type" : " object" ,
72
+ "required" : [
73
+ " start_lat" ,
74
+ " start_long" ,
75
+ " end_lat" ,
76
+ " end_long" ,
77
+ " rider_name" ,
78
+ " driver_name" ,
79
+ " driver_vehicle"
80
+ ],
81
+ "properties" : {
82
+ "start_lat" : {
83
+ "type" : " integer" ,
84
+ "minimum" : -90 ,
85
+ "maximum" : 90 ,
86
+ "example" : 90
87
+ },
88
+ "start_long" : {
89
+ "type" : " integer" ,
90
+ "minimum" : -180 ,
91
+ "maximum" : 180 ,
92
+ "example" : 180
93
+ },
94
+ "end_lat" : {
95
+ "type" : " integer" ,
96
+ "minimum" : -90 ,
97
+ "maximum" : 90 ,
98
+ "example" : -90
99
+ },
100
+ "end_long" : {
101
+ "type" : " integer" ,
102
+ "minimum" : -180 ,
103
+ "maximum" : 180 ,
104
+ "example" : -180
105
+ },
106
+ "rider_name" : {
107
+ "type" : " string" ,
108
+ "example" : " Joshua"
109
+ },
110
+ "driver_name" : {
111
+ "type" : " string" ,
112
+ "example" : " John"
113
+ },
114
+ "driver_vehicle" : {
115
+ "type" : " string" ,
116
+ "example" : " Truck"
117
+ }
118
+ }
119
+ }
120
+ },
121
+ "paths" : {
122
+ "/health" : {
123
+ "get" : {
124
+ "summary" : " Health check endpoint for the server" ,
125
+ "description" : " Checks if the server is running" ,
126
+ "operationId" : " healthcheck" ,
127
+ "responses" : {
128
+ "200" : {
129
+ "description" : " Server is up and running"
130
+ }
131
+ }
132
+ }
133
+ },
134
+
135
+ "/rides" : {
136
+ "get" : {
137
+ "summary" : " Get all saved rides" ,
138
+ "description" : " Get all saved rides" ,
139
+ "produces" : [
140
+ " application/json"
141
+ ],
142
+ "operationId" : " getRides" ,
143
+ "responses" : {
144
+ "200" : {
145
+ "schema" : {
146
+ "type" : " array" ,
147
+ "items" : {
148
+ "$ref" : " #/definitions/RideOutput"
149
+ }
150
+ },
151
+ "description" : " Successful operation"
152
+ }
153
+ }
154
+ },
155
+ "post" : {
156
+ "summary" : " Add a new ride" ,
157
+ "description" : " Add a new ride" ,
158
+ "operationId" : " addRide" ,
159
+ "consumes" : [
160
+ " application/json"
161
+ ],
162
+ "produces" : [
163
+ " application/json"
164
+ ],
165
+ "parameters" : [
166
+ {
167
+ "in" : " body" ,
168
+ "name" : " body" ,
169
+ "description" : " Rider object that needs to be added" ,
170
+ "required" : true ,
171
+ "schema" : {
172
+ "$ref" : " #/definitions/RideInput"
173
+ }
174
+ }
175
+ ],
176
+ "responses" : {
177
+ "200" : {
178
+ "description" : " Successfully added new ride"
179
+ }
180
+ }
181
+ }
182
+ },
183
+
184
+ "/rides/{rideId}" : {
185
+ "get" : {
186
+ "summary" : " Get saved ride by id" ,
187
+ "description" : " Get saved ride by id" ,
188
+ "produces" : [
189
+ " application/json"
190
+ ],
191
+ "parameters" : [
192
+ {
193
+ "name" : " rideId" ,
194
+ "in" : " path" ,
195
+ "description" : " ID of ride to return" ,
196
+ "required" : true ,
197
+ "type" : " integer"
198
+ }
199
+ ],
200
+ "operationId" : " getRideById" ,
201
+ "responses" : {
202
+ "200" : {
203
+ "schema" : {
204
+ "type" : " array" ,
205
+ "items" : {
206
+ "$ref" : " #/definitions/RideOutput"
207
+ }
208
+ },
209
+ "description" : " Successful operation"
210
+ }
211
+ }
212
+ }
213
+ }
214
+ },
215
+ "host" : " localhost:8010" ,
216
+ "basePath" : " /"
217
+ }
0 commit comments