Hit JavaScript error when you press the execute button on the docs page
arlexw90 opened this issue · comments
- L5-Swagger Version: 5.5.*
- PHP Version (
php -v
): 7.4 - Laravel Version: 5.5.*
Description:
Steps To Reproduce:
.../app/Http/Controllers/Controller.php
/**
* @SWG\Swagger(
* @SWG\Info(
* title="Site Title",
* version="1.0",
* description="Site description",
* @SWG\Contact(
* email="xyz@xyz.com"
* )
* )
* )
*/
../app/Http/Controllers/ProductController.php
/**
* @SWG\Get(
* path="/api/products",
* summary="Get list User",
* description="Returns User data",
* security={{"bearerAuth":{}}},
* @SWG\Response(
* response=200,
* description="Successful operation",
* ),
* @SWG\Response(
* response=400,
* description="Bad Request"
* ),
* @SWG\Response(
* response=401,
* description="Unauthenticated",
* ),
* @SWG\Response(
* response=403,
* description="Forbidden"
* )
* )
*/
Access http://127.0.0.1:8000/api/documentation then click the execute button, it doesn't render any response but I noticed some error shown on the console area, you can check my screenshot at above.
You need to check your base path is set correctly: https://github.com/DarkaOnLine/L5-Swagger/blob/master/config/l5-swagger.php#L90
I have the same problem.
I tried to set the base path through L5_SWAGGER_BASE_PATH
on the .env file, but I get this error:
$ php artisan l5-swagger:generate
Regenerating docs
In Logger.php line 39:
Unexpected field "basePath" for @OA\OpenApi(), expecting "openapi", "info", "servers", "paths", "components", "security", "tags", "externalDocs", "x" in
I think this PR is missing on the 5.5x branch, right? #147