Я хочу получить заголовок, который имеет apitoken на предъявителя.Я уже определяю заголовок в аннотации в моем контроллере, но когда я попробовал его в swagger, swagger не может получить заголовок.
Вот мой контроллер:
/**
* @SWG\SecurityScheme(
* @SWG\Swagger(
* schemes={"https"},
* @SWG\SecurityDefinitions(
* bearer={
* type="apiKey",
* name="Authorization",
* in="header"
* }
* ),
* @OA\Get(
* path="/boards",
* tags={"Show ALL Board"},
* @OA\Parameter(
* name="Authorization",
* in="header",
* description="Header for API Token (with 'bearer ' first). ex : bearer api_token",
* required=true,
* @OA\Schema(type="string")
* ),
* @OA\Response(
* response="200",
* description="Returns all Boards",
* @OA\JsonContent()
* ),
* @OA\Response(
* response="400",
* description="Error: Bad request. When required parameters were not supplied.",
* ),
* @OA\Response(
* response="401",
* description="Error: Unauthorized User. Header with API token required",
* ),
* )
*/
public function index(Request $request)
{
return response()->json([
'status' => 'error',
'message' => $request->header('Authorization')
], 400);
}
Любая помощьбыл бы признателен.Спасибо!