I'm using this package https://github.com/mpociot/laravel-apidoc-generator to generate api documentation but i got couple problems:
1- Running requests in the docs always return "unauthenticated" how to configure this in a right way? i tried to add the login token to apidoc.php
in authorization
but it didn't work.
some people said i should do this php artisan api:generate --actAsUserId=1
but it returns
The "--actAsUserId" option does not exist.
2- some request need email
as @bodyParam but couldn't find a type of email
so i use text
which of course fails and return invalid type. how to force type email?
Thanks in advance, hope i was clear.
try this
/**
* @authenticated <------
* @group MyGrupo
*
*/
class MyController extends Controller{
}
and in your console: #php artisan apidoc:generate
I'm a former maintainer of laravel-apidoc-generator. The package is no longer supported. Here's the one you should be using: knuckleswtf/scribe .
To pass an auth value in Scribe, you set auth.use_value
to the token in your config file. That's it. You can see more in the docs .
The details in the apply.headers
section are only used in the HTML docs, not in response calls.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.