I am installed
composer require "darkaonline/l5-swagger:5.6.*",
and i have a api-docs.json from a swagger that I added to storage/api-docs/api-docs.json.
But when i go to
http://127.0.0.1:8000/api/documentation
I got error
Fetch error Not Found http://127.0.0.1:8000/docs/api-docs.json
I tried to run
php artisan l5-swagger:generate
but it logically returns an error
Required @OAInfo() not found
because it wants me to manually enter all the api information in the classes, but my api is quite large so it will take me a long time to rewrite it.
Can darkaonline/l5-swagger
just read my api-docs.json file from the storage?
2
Answers
Look in the documentation maybe you will find the solution
https://zircote.github.io/swagger-php/guide/faq.html#warning-required-oa-info-not-found
You need to add the
Info
as mentioned in the error.A simple, yet powerful solution would be adding it to
AppHttpController::class
:This will ensure that the
Info
is added to all your requests as well.You can then easily add your PathItems, as en example for
AppHttpControllerApiHeartbeatController::class
: