Skip to content

Commit b17f4b8

Browse files
committed
Refactor API endpoint descriptions in HotelController, RouteController, and AirportController
1 parent a064c1d commit b17f4b8

File tree

5 files changed

+315
-85
lines changed

5 files changed

+315
-85
lines changed

app/Http/Controllers/AirlineController.php

Lines changed: 88 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,20 @@ private function validateRequest(Request $request)
4242
* path="/api/v1/airlines/list",
4343
* operationId="getAirlinesList",
4444
* tags={"Airlines"},
45-
* summary="Get list of airlines",
46-
* description="Returns list of airlines",
45+
* summary="List Airlines",
46+
* description="Get List of Airlines
47+
48+
This provides an example
49+
of using Query operations
50+
in Couchbase to retrieve a list of airlines.
51+
52+
Query operations
53+
are unique to Couchbase and allow you to search, transform, and analyze data in your documents
54+
55+
Code:
56+
[app/Http/Controllers/AirlineController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirlineController.php)
57+
58+
Method: index",
4759
* @OA\Parameter(
4860
* name="offset",
4961
* in="query",
@@ -111,8 +123,20 @@ public function index(Request $request)
111123
* path="/api/v1/airlines/{id}",
112124
* operationId="getAirlineById",
113125
* tags={"Airlines"},
114-
* summary="Get airline information",
115-
* description="Returns airline data",
126+
* summary="Get Document",
127+
* description="Get Airline with specified ID
128+
129+
This provides an example
130+
of using Key Value operations
131+
in Couchbase to retrieve a document with specified ID.
132+
133+
Key Value operations
134+
are unique to Couchbase and provide very high speed get/set/delete operations
135+
136+
Code:
137+
[app/Http/Controllers/AirlineController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirlineController.php)
138+
139+
Method: show",
116140
* @OA\Parameter(
117141
* name="id",
118142
* in="path",
@@ -155,8 +179,20 @@ public function show($id)
155179
* path="/api/v1/airlines/{id}",
156180
* operationId="createAirline",
157181
* tags={"Airlines"},
158-
* summary="Create a new airline",
159-
* description="Create a new airline",
182+
* summary="Create Document",
183+
* description="Create Airline with specified ID
184+
185+
This provides an example
186+
of using Key Value operations
187+
in Couchbase to create a document with specified ID.
188+
189+
Key Value operations
190+
are unique to Couchbase and provide very high speed get/set/delete operations
191+
192+
Code:
193+
[app/Http/Controllers/AirlineController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirlineController.php)
194+
195+
Method: store",
160196
* @OA\Parameter(
161197
* name="id",
162198
* in="path",
@@ -206,8 +242,20 @@ public function store(Request $request, $id)
206242
* path="/api/v1/airlines/{id}",
207243
* operationId="updateAirline",
208244
* tags={"Airlines"},
209-
* summary="Update an existing airline or create a new one if it does not exist",
210-
* description="Update an existing airline or create a new one if it does not exist",
245+
* summary="Update Document",
246+
* description="Update Airline with specified ID
247+
248+
This provides an example
249+
of using Key Value operations
250+
in Couchbase to update a document with specified ID.
251+
252+
Key Value operations
253+
are unique to Couchbase and provide very high speed get/set/delete operations
254+
255+
Code:
256+
[app/Http/Controllers/AirlineController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirlineController.php)
257+
258+
Method: update",
211259
* @OA\Parameter(
212260
* name="id",
213261
* in="path",
@@ -217,7 +265,7 @@ public function store(Request $request, $id)
217265
* )
218266
* ),
219267
* @OA\RequestBody(
220-
* description="Airline object that needs to be updated or created",
268+
* description="Airline object that needs to be updated",
221269
* required=true,
222270
* @OA\JsonContent(ref="#/components/schemas/Airline")
223271
* ),
@@ -226,8 +274,8 @@ public function store(Request $request, $id)
226274
* description="Successful operation"
227275
* ),
228276
* @OA\Response(
229-
* response=201,
230-
* description="Resource created successfully"
277+
* response=404,
278+
* description="Not Found"
231279
* ),
232280
* @OA\Response(
233281
* response=422,
@@ -268,11 +316,23 @@ public function update(Request $request, $id)
268316

269317
/**
270318
* @OA\Delete(
271-
* path="/api/v1/airlines/{id}",
319+
* path="/api/v1/airline/{id}",
272320
* operationId="deleteAirline",
273321
* tags={"Airlines"},
274-
* summary="Delete an airline",
275-
* description="Delete an airline",
322+
* summary="Delete Document",
323+
* description="Delete Airline with specified ID
324+
325+
This provides an example
326+
of using Key Value operations
327+
in Couchbase to delete a document with specified ID.
328+
329+
Key Value operations
330+
are unique to Couchbase and provide very high speed get/set/delete operations
331+
332+
Code:
333+
[app/Http/Controllers/AirlineController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirlineController.php)
334+
335+
Method: deleteAirline",
276336
* @OA\Parameter(
277337
* name="id",
278338
* in="path",
@@ -317,8 +377,20 @@ public function destroy($id)
317377
* path="/api/v1/airlines/to-airport/{destinationAirportCode}",
318378
* operationId="getAirlinesToAirport",
319379
* tags={"Airlines"},
320-
* summary="Get airlines flying to a destination airport",
321-
* description="Returns list of airlines flying to a specific airport",
380+
* summary="List Airlines to Airport",
381+
* description="Get Airlines flying to specified Airport
382+
383+
This provides an example
384+
of using Query operations
385+
in Couchbase to find airlines flying to a specific airport.
386+
387+
Query operations
388+
are unique to Couchbase and allow you to search, transform, and analyze data in your documents
389+
390+
Code:
391+
[app/Http/Controllers/AirlineController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirlineController.php)
392+
393+
Method: toAirport",
322394
* @OA\Parameter(
323395
* name="destinationAirportCode",
324396
* in="path",

app/Http/Controllers/AirportController.php

Lines changed: 84 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,20 @@ private function validateRequest(Request $request)
4949
* path="/api/v1/airports/list",
5050
* operationId="getAirportsList",
5151
* tags={"Airports"},
52-
* summary="Get list of airports",
53-
* description="Returns list of airports",
52+
* summary="List Airports",
53+
* description="Get List of Airports
54+
55+
This provides an example
56+
of using Query operations
57+
in Couchbase to retrieve a list of airports.
58+
59+
Query operations
60+
are unique to Couchbase and allow you to search, transform, and analyze data in your documents
61+
62+
Code:
63+
[app/Http/Controllers/AirportController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirportController.php)
64+
65+
Method: index",
5466
* @OA\Parameter(
5567
* name="offset",
5668
* in="query",
@@ -108,8 +120,20 @@ public function index(Request $request)
108120
* path="/api/v1/airports/{id}",
109121
* operationId="getAirportById",
110122
* tags={"Airports"},
111-
* summary="Get airport information",
112-
* description="Returns airport data",
123+
* summary="Get Document",
124+
* description="Get Airport with specified ID
125+
126+
This provides an example
127+
of using Key Value operations
128+
in Couchbase to retrieve a document with specified ID.
129+
130+
Key Value operations
131+
are unique to Couchbase and provide very high speed get/set/delete operations
132+
133+
Code:
134+
[app/Http/Controllers/AirportController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirportController.php)
135+
136+
Method: show",
113137
* @OA\Parameter(
114138
* name="id",
115139
* in="path",
@@ -152,8 +176,20 @@ public function show($id)
152176
* path="/api/v1/airports/{id}",
153177
* operationId="createAirport",
154178
* tags={"Airports"},
155-
* summary="Create a new airport",
156-
* description="Create a new airport",
179+
* summary="Create Document",
180+
* description="Create Airport with specified ID
181+
182+
This provides an example
183+
of using Key Value operations
184+
in Couchbase to create a document with specified ID.
185+
186+
Key Value operations
187+
are unique to Couchbase and provide very high speed get/set/delete operations
188+
189+
Code:
190+
[app/Http/Controllers/AirportController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirportController.php)
191+
192+
Method: store",
157193
* @OA\Parameter(
158194
* name="id",
159195
* in="path",
@@ -203,8 +239,20 @@ public function store(Request $request, $id)
203239
* path="/api/v1/airports/{id}",
204240
* operationId="updateAirport",
205241
* tags={"Airports"},
206-
* summary="Update an existing airport or create a new one if it does not exist",
207-
* description="Update an existing airport or create a new one if it does not exist",
242+
* summary="Update Document",
243+
* description="Update Airport with specified ID
244+
245+
This provides an example
246+
of using Key Value operations
247+
in Couchbase to update a document with specified ID.
248+
249+
Key Value operations
250+
are unique to Couchbase and provide very high speed get/set/delete operations
251+
252+
Code:
253+
[app/Http/Controllers/AirportController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirportController.php)
254+
255+
Method: update",
208256
* @OA\Parameter(
209257
* name="id",
210258
* in="path",
@@ -268,8 +316,20 @@ public function update(Request $request, $id)
268316
* path="/api/v1/airports/{id}",
269317
* operationId="deleteAirport",
270318
* tags={"Airports"},
271-
* summary="Delete an airport",
272-
* description="Delete an airport",
319+
* summary="Delete Document",
320+
* description="Delete Airport with specified ID
321+
322+
This provides an example
323+
of using Key Value operations
324+
in Couchbase to delete a document with specified ID.
325+
326+
Key Value operations
327+
are unique to Couchbase and provide very high speed get/set/delete operations
328+
329+
Code:
330+
[app/Http/Controllers/AirportController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirportController.php)
331+
332+
Method: deleteAirport",
273333
* @OA\Parameter(
274334
* name="id",
275335
* in="path",
@@ -314,8 +374,20 @@ public function destroy($id)
314374
* path="/api/v1/airports/direct-connections",
315375
* operationId="getDirectConnections",
316376
* tags={"Airports"},
317-
* summary="Get airports with direct flights from a target airport",
318-
* description="Returns list of airports that have direct flights from a target airport",
377+
* summary="List Direct Connections",
378+
* description="Get Airports with Direct Connections
379+
380+
This provides an example
381+
of using Query operations
382+
in Couchbase to find airports with direct flight connections.
383+
384+
Query operations
385+
are unique to Couchbase and allow you to search, transform, and analyze data in your documents
386+
387+
Code:
388+
[app/Http/Controllers/AirportController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/AirportController.php)
389+
390+
Method: getDirectConnections",
319391
* @OA\Parameter(
320392
* name="sourceAirportCode",
321393
* in="query",

app/Http/Controllers/HotelController.php

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,20 @@ class HotelController extends Controller
1313
* path="/api/v1/hotels/autocomplete",
1414
* operationId="searchHotels",
1515
* tags={"Hotels"},
16-
* summary="Search for hotels by name",
17-
* description="Returns a list of hotels that match the provided name",
16+
* summary="Search Hotels",
17+
* description="Search Hotels by Name
18+
19+
This provides an example
20+
of using Query operations
21+
in Couchbase to perform a search with autocomplete functionality.
22+
23+
Query operations
24+
are unique to Couchbase and allow you to search, transform, and analyze data in your documents
25+
26+
Code:
27+
[app/Http/Controllers/HotelController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/HotelController.php)
28+
29+
Method: search",
1830
* @OA\Parameter(
1931
* name="name",
2032
* in="query",
@@ -72,8 +84,20 @@ public function search(Request $request)
7284
* path="/api/v1/hotels/filter",
7385
* operationId="filterHotels",
7486
* tags={"Hotels"},
75-
* summary="Filter hotels by various attributes",
76-
* description="Returns a list of hotels that match the provided filters",
87+
* summary="Filter Hotels",
88+
* description="Filter Hotels by Multiple Attributes
89+
90+
This provides an example
91+
of using Query operations
92+
in Couchbase to filter documents using multiple criteria.
93+
94+
Query operations
95+
are unique to Couchbase and allow you to search, transform, and analyze data in your documents
96+
97+
Code:
98+
[app/Http/Controllers/HotelController.php](https://github.com/couchbase-examples/php-laravel-quickstart/blob/main/app/Http/Controllers/HotelController.php)
99+
100+
Method: filter",
77101
* @OA\Parameter(
78102
* name="name",
79103
* in="query",

0 commit comments

Comments
 (0)