PHP code example of suzunone / l-auto-comment-for-php-swagger
1. Go to this page and download the library: Download suzunone/l-auto-comment-for-php-swagger library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
suzunone / l-auto-comment-for-php-swagger example snippets
/**
* Here is the description of the API
*
* @openapi
* @openapi-tags TAG-A
* @openapi-tags TAG-B
* @openapi-response 200 #/components/schemas/ExampleModel Success
* @openapi-response 400 #/components/schemas/Error Bad Request
* @openapi-response 403 #/components/schemas/Error Forbidden
* @openapi-response 404 #/components/schemas/Error Not Found
* @openapi-response 405 #/components/schemas/Error Invalid Input
*/
/**
* @OA\Get(
* tags={"TAG-A", "TAG-B"},
* operationId="exampleIndex",
* path="/api/example",
* description="Here is the description of the API",
*
* @OA\Response(
* response="200",
* description="Success",
* @OA\JsonContent(ref="#/components/schemas/ExampleModel")
* ),
* @OA\Response(
* response="400",
* description="Bad Request",
* @OA\JsonContent(ref="#/components/schemas/CommonError")
* ),
* @OA\Response(
* response="403",
* description="Forbidden",
* @OA\JsonContent(ref="#/components/schemas/CommonError")
* ),
* @OA\Response(
* response="404",
* description="Not Found",
* @OA\JsonContent(ref="#/components/schemas/CommonError")
* ),
* @OA\Response(
* response="405",
* description="Invalid Input",
* @OA\JsonContent(ref="#/components/schemas/CommonError")
* ),
* )
*/
shell
php artisan vendor:publish --provider="AutoCommentForPHPSwagger\LAutoCommentForPHPSwaggerServiceProvider" --tag=config