0
我安装了“darkaonline/l5-swagger”:“〜3.0”来获取我的Laravel 5.3项目中的Swagger,并且我想为用户设置一个api_key值,通过swagger测试我的api get acces或者不会比较他输入的api_key值与一个矿。swagger安全Laravel
我有这对我的security.php:
/**
* @SWG\SecurityScheme(
* securityDefinition="api_key",
* type="apiKey",
* in="header",
* name="api_key"
*)
*/
和我UserController的:
/**
* @SWG\Post(
* path="/add_user",
* tags={"user"},
* operationId="adduser",
* summary="Add a new user to the store",
* description="",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="name",
* in="formData",
* type="string",
* description="Name of the user",
* required=true,
* ),
* @SWG\Parameter(
* name="lastname",
* in="formData",
* type="string",
* description="Lastname of the user",
* required=true,
* ),
* @SWG\Parameter(
* name="email",
* in="formData",
* type="string",
* description="Email of the user",
* required=true,
* ),
* @SWG\Parameter(
* name="password",
* in="formData",
* type="string",
* description="password of the user",
* required=true,
* ),
* @SWG\Parameter(
* name="website",
* in="formData",
* type="string",
* description="website of the user",
* required=true,
* ),
* @SWG\Parameter(
* name="platform",
* in="formData",
* type="string",
* description="website of the user",
* required=true,
* ),
* @SWG\Response(
* response=405,
* description="Invalid input",
* ),
* security={
* {
* "api_key": {},
* }
* },
*)
*/
,但我可以存储一个新的用户,即使我没有一个API_KEY值增加我的网址或授权对话框。我错过了什么?
@KhorneHoly谢谢我错过了那部分 –
嗨杰拉德,你可以在这个问题上建议我。 https://stackoverflow.com/questions/45839934/laravel-post-delete-put-routes-in-swagger – Arvind