Swagger Laravel 5.5

时间:2017-11-24 13:23:19

标签: laravel annotations swagger api-doc

我正在使用"darkaonline/l5-swagger": "^5.5",将swagger集成到我的项目中。并完成配置它的整个步骤。

这是我的功能

/**
 * @SWG\Get(
 *   path="/clients",
 *   summary="List clients",
 *   operationId="listClients",
 *   tags={"client"},
 *   @SWG\Response(
 *     response=200,
 *     description="A list of clients",
 *      @SWG\Schema(type="array", @SWG\Items(ref="#/definitions/Client"))
 *   ),
 *   @SWG\Response(
 *     response="default",
 *     description="an ""unexpected"" error"
 *   )
 * )
 */
public function index()
{
    $clients = Client::scope()
        ->orderBy('created_at', 'desc')
        ->withTrashed();

    if ($email = Input::get('email')) {
        $clients = $clients->whereHas('contacts', function ($query) use ($email) {
            $query->where('email', $email);
        });
    } elseif ($idNumber = Input::get('id_number')) {
        $clients = $clients->whereIdNumber($idNumber);
    }

    return $this->listResponse($clients);
}

我收到此错误$ref "#/definitions/Client" not found for @SWG\Items() in \App\Http\Controllers\Api\ClientApiController->index()

任何人都可以帮助我摆脱这个。感谢Advanc。

0 个答案:

没有答案