我正在使用"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()