如何在“ mpociot / laravel-apidoc-generator”:“ ^ 2.1”包中定义URL参数的描述

时间:2019-01-16 10:21:57

标签: php laravel laravel-5.4

如何定义url参数的描述?

我想使用laravel 5.4和“ mpociot / laravel-apidoc-generator”:“ ^ 2.1”软件包。

就像图像中所示。

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以像这样使用bodyParam批注:

/**
 * Database authentication
 *
 * @bodyParam email string required Email address.
 * @bodyParam password string required Users password.
 * @param UserAuthenticationRequest $request
 * @return JsonResponse
 * @response JsonResponse
 * @throws AuthenticationException
 */
public function authenticate(UserAuthenticationRequest $request): JsonResponse {
...
}

有关更多信息,请阅读laravel apidoc generator docs