L5-Swagger: Can't read swagger JSON
i follow your documentation
and after i publish everything
i go to the path http://localhost:8090/api/documentation and i have this error
Can't read swagger JSON from http://localhost:8090/docs/api-docs.json
what i suppose to do ?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (4 by maintainers)
Had this problem due to using PHP built-in web server and not artisan serve.
Glad you figured it out.
By the way, you can set L5_SWAGGER_GENERATE_ALWAYS=true in your config file, so that json file will be regenerated on every request. Just disable it in production environment π
@ahmed-al-bermawy I missed the middleware part π
you donβt have to link it manually
you just need to set the routes API for me
so i access it from URL with this link
http://localhost:8000/backend/api/documentation
also, you need to check the middleware for me it is
It looks like your stand alone php server is not generating .json file. Can you see your documentation .json file in desired directory when you start your php server ? Does
L5_SWAGGER_GENERATE_ALWAYS
is set to TRUE ?Like you can see this problem is not associated with package it self because it is working on
php artisan serve
Getting this error
But when i open this link βhttp://127.0.0.1:8000/docs/api-docs.jsonβ it works fine. & render JSON on browser
it is working now after i run
php artisan l5-swagger:generate