|
219 | 219 | });
|
220 | 220 |
|
221 | 221 |
|
222 |
| -/** |
223 |
| - * DELETE deletePet |
224 |
| - * Summary: Deletes a pet |
225 |
| - * Notes: |
226 |
| -
|
227 |
| - */ |
228 |
| -$app->DELETE('/v2/pet/{petId}', function($request, $response, $args) { |
229 |
| - $headers = $request->getHeaders(); |
230 |
| - |
231 |
| - |
232 |
| - |
233 |
| - $response->write('How about implementing deletePet as a DELETE method ?'); |
234 |
| - return $response; |
235 |
| - }); |
236 |
| - |
237 |
| - |
238 | 222 | /**
|
239 | 223 | * GET findPetsByStatus
|
240 | 224 | * Summary: Finds Pets by status
|
|
270 | 254 |
|
271 | 255 |
|
272 | 256 | /**
|
273 |
| - * GET getPetById |
274 |
| - * Summary: Find pet by ID |
275 |
| - * Notes: Returns a single pet |
276 |
| - * Output-Formats: [application/xml, application/json] |
| 257 | + * PUT updatePet |
| 258 | + * Summary: Update an existing pet |
| 259 | + * Notes: |
| 260 | +
|
277 | 261 | */
|
278 |
| -$app->GET('/v2/pet/{petId}', function($request, $response, $args) { |
279 |
| - |
| 262 | +$app->PUT('/v2/pet', function($request, $response, $args) { |
280 | 263 |
|
281 | 264 |
|
282 | 265 |
|
283 |
| - $response->write('How about implementing getPetById as a GET method ?'); |
| 266 | + $body = $request->getParsedBody(); |
| 267 | + $response->write('How about implementing updatePet as a PUT method ?'); |
284 | 268 | return $response;
|
285 | 269 | });
|
286 | 270 |
|
287 | 271 |
|
288 | 272 | /**
|
289 |
| - * PUT updatePet |
290 |
| - * Summary: Update an existing pet |
| 273 | + * DELETE deletePet |
| 274 | + * Summary: Deletes a pet |
291 | 275 | * Notes:
|
292 | 276 |
|
293 | 277 | */
|
294 |
| -$app->PUT('/v2/pet', function($request, $response, $args) { |
| 278 | +$app->DELETE('/v2/pet/{petId}', function($request, $response, $args) { |
| 279 | + $headers = $request->getHeaders(); |
295 | 280 |
|
296 | 281 |
|
297 | 282 |
|
298 |
| - $body = $request->getParsedBody(); |
299 |
| - $response->write('How about implementing updatePet as a PUT method ?'); |
| 283 | + $response->write('How about implementing deletePet as a DELETE method ?'); |
| 284 | + return $response; |
| 285 | + }); |
| 286 | + |
| 287 | + |
| 288 | +/** |
| 289 | + * GET getPetById |
| 290 | + * Summary: Find pet by ID |
| 291 | + * Notes: Returns a single pet |
| 292 | + * Output-Formats: [application/xml, application/json] |
| 293 | + */ |
| 294 | +$app->GET('/v2/pet/{petId}', function($request, $response, $args) { |
| 295 | + |
| 296 | + |
| 297 | + |
| 298 | + |
| 299 | + $response->write('How about implementing getPetById as a GET method ?'); |
300 | 300 | return $response;
|
301 | 301 | });
|
302 | 302 |
|
|
334 | 334 |
|
335 | 335 |
|
336 | 336 | /**
|
337 |
| - * DELETE deleteOrder |
338 |
| - * Summary: Delete purchase order by ID |
339 |
| - * Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors |
340 |
| -
|
| 337 | + * GET getInventory |
| 338 | + * Summary: Returns pet inventories by status |
| 339 | + * Notes: Returns a map of status codes to quantities |
| 340 | + * Output-Formats: [application/json] |
341 | 341 | */
|
342 |
| -$app->DELETE('/v2/store/order/{order_id}', function($request, $response, $args) { |
| 342 | +$app->GET('/v2/store/inventory', function($request, $response, $args) { |
343 | 343 |
|
344 | 344 |
|
345 | 345 |
|
346 | 346 |
|
347 |
| - $response->write('How about implementing deleteOrder as a DELETE method ?'); |
| 347 | + $response->write('How about implementing getInventory as a GET method ?'); |
348 | 348 | return $response;
|
349 | 349 | });
|
350 | 350 |
|
351 | 351 |
|
352 | 352 | /**
|
353 |
| - * GET getInventory |
354 |
| - * Summary: Returns pet inventories by status |
355 |
| - * Notes: Returns a map of status codes to quantities |
356 |
| - * Output-Formats: [application/json] |
| 353 | + * POST placeOrder |
| 354 | + * Summary: Place an order for a pet |
| 355 | + * Notes: |
| 356 | + * Output-Formats: [application/xml, application/json] |
357 | 357 | */
|
358 |
| -$app->GET('/v2/store/inventory', function($request, $response, $args) { |
359 |
| - |
| 358 | +$app->POST('/v2/store/order', function($request, $response, $args) { |
360 | 359 |
|
361 | 360 |
|
362 | 361 |
|
363 |
| - $response->write('How about implementing getInventory as a GET method ?'); |
| 362 | + $body = $request->getParsedBody(); |
| 363 | + $response->write('How about implementing placeOrder as a POST method ?'); |
364 | 364 | return $response;
|
365 | 365 | });
|
366 | 366 |
|
367 | 367 |
|
368 | 368 | /**
|
369 |
| - * GET getOrderById |
370 |
| - * Summary: Find purchase order by ID |
371 |
| - * Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions |
372 |
| - * Output-Formats: [application/xml, application/json] |
| 369 | + * DELETE deleteOrder |
| 370 | + * Summary: Delete purchase order by ID |
| 371 | + * Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors |
| 372 | +
|
373 | 373 | */
|
374 |
| -$app->GET('/v2/store/order/{order_id}', function($request, $response, $args) { |
| 374 | +$app->DELETE('/v2/store/order/{order_id}', function($request, $response, $args) { |
375 | 375 |
|
376 | 376 |
|
377 | 377 |
|
378 | 378 |
|
379 |
| - $response->write('How about implementing getOrderById as a GET method ?'); |
| 379 | + $response->write('How about implementing deleteOrder as a DELETE method ?'); |
380 | 380 | return $response;
|
381 | 381 | });
|
382 | 382 |
|
383 | 383 |
|
384 | 384 | /**
|
385 |
| - * POST placeOrder |
386 |
| - * Summary: Place an order for a pet |
387 |
| - * Notes: |
| 385 | + * GET getOrderById |
| 386 | + * Summary: Find purchase order by ID |
| 387 | + * Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions |
388 | 388 | * Output-Formats: [application/xml, application/json]
|
389 | 389 | */
|
390 |
| -$app->POST('/v2/store/order', function($request, $response, $args) { |
| 390 | +$app->GET('/v2/store/order/{order_id}', function($request, $response, $args) { |
391 | 391 |
|
392 | 392 |
|
393 | 393 |
|
394 |
| - $body = $request->getParsedBody(); |
395 |
| - $response->write('How about implementing placeOrder as a POST method ?'); |
| 394 | + |
| 395 | + $response->write('How about implementing getOrderById as a GET method ?'); |
396 | 396 | return $response;
|
397 | 397 | });
|
398 | 398 |
|
|
446 | 446 |
|
447 | 447 |
|
448 | 448 | /**
|
449 |
| - * DELETE deleteUser |
450 |
| - * Summary: Delete user |
451 |
| - * Notes: This can only be done by the logged in user. |
452 |
| -
|
| 449 | + * GET loginUser |
| 450 | + * Summary: Logs user into the system |
| 451 | + * Notes: |
| 452 | + * Output-Formats: [application/xml, application/json] |
453 | 453 | */
|
454 |
| -$app->DELETE('/v2/user/{username}', function($request, $response, $args) { |
455 |
| - |
| 454 | +$app->GET('/v2/user/login', function($request, $response, $args) { |
456 | 455 |
|
| 456 | + $queryParams = $request->getQueryParams(); |
| 457 | + $username = $queryParams['username']; $password = $queryParams['password']; |
457 | 458 |
|
458 | 459 |
|
459 |
| - $response->write('How about implementing deleteUser as a DELETE method ?'); |
| 460 | + $response->write('How about implementing loginUser as a GET method ?'); |
460 | 461 | return $response;
|
461 | 462 | });
|
462 | 463 |
|
463 | 464 |
|
464 | 465 | /**
|
465 |
| - * GET getUserByName |
466 |
| - * Summary: Get user by user name |
| 466 | + * GET logoutUser |
| 467 | + * Summary: Logs out current logged in user session |
467 | 468 | * Notes:
|
468 |
| - * Output-Formats: [application/xml, application/json] |
| 469 | +
|
469 | 470 | */
|
470 |
| -$app->GET('/v2/user/{username}', function($request, $response, $args) { |
| 471 | +$app->GET('/v2/user/logout', function($request, $response, $args) { |
471 | 472 |
|
472 | 473 |
|
473 | 474 |
|
474 | 475 |
|
475 |
| - $response->write('How about implementing getUserByName as a GET method ?'); |
| 476 | + $response->write('How about implementing logoutUser as a GET method ?'); |
476 | 477 | return $response;
|
477 | 478 | });
|
478 | 479 |
|
479 | 480 |
|
480 | 481 | /**
|
481 |
| - * GET loginUser |
482 |
| - * Summary: Logs user into the system |
483 |
| - * Notes: |
484 |
| - * Output-Formats: [application/xml, application/json] |
| 482 | + * DELETE deleteUser |
| 483 | + * Summary: Delete user |
| 484 | + * Notes: This can only be done by the logged in user. |
| 485 | +
|
485 | 486 | */
|
486 |
| -$app->GET('/v2/user/login', function($request, $response, $args) { |
| 487 | +$app->DELETE('/v2/user/{username}', function($request, $response, $args) { |
487 | 488 |
|
488 |
| - $queryParams = $request->getQueryParams(); |
489 |
| - $username = $queryParams['username']; $password = $queryParams['password']; |
490 | 489 |
|
491 | 490 |
|
492 |
| - $response->write('How about implementing loginUser as a GET method ?'); |
| 491 | + |
| 492 | + $response->write('How about implementing deleteUser as a DELETE method ?'); |
493 | 493 | return $response;
|
494 | 494 | });
|
495 | 495 |
|
496 | 496 |
|
497 | 497 | /**
|
498 |
| - * GET logoutUser |
499 |
| - * Summary: Logs out current logged in user session |
| 498 | + * GET getUserByName |
| 499 | + * Summary: Get user by user name |
500 | 500 | * Notes:
|
501 |
| -
|
| 501 | + * Output-Formats: [application/xml, application/json] |
502 | 502 | */
|
503 |
| -$app->GET('/v2/user/logout', function($request, $response, $args) { |
| 503 | +$app->GET('/v2/user/{username}', function($request, $response, $args) { |
504 | 504 |
|
505 | 505 |
|
506 | 506 |
|
507 | 507 |
|
508 |
| - $response->write('How about implementing logoutUser as a GET method ?'); |
| 508 | + $response->write('How about implementing getUserByName as a GET method ?'); |
509 | 509 | return $response;
|
510 | 510 | });
|
511 | 511 |
|
|
0 commit comments