私はSwaggerを使用するのがかなり新しいです。私のプロジェクトはLaravelと一緒になっているので、私はSwaggerevelを使ってAPIを文書化しています。私は、次のように生成する必要な@SWG Info()が見つかりません
./vendor/bin/swagger app/ -o storage/docs/api-docs.json
をしようとした時にはそれは私がそれlocalhost:8000/docs
、アクセスしようとしたとき
[INFO] Required @SWG\Info() not found
get /api/resource.json
-----------------------
1 operations documented
-----------------------
Written to /home/admin/api/gevme-api/storage/docs/api-docs.json
すると、それが適切に私が生成されたJSON APIを示すことを示しています。しかし、localhost:8000/api-docs
にアクセスしようとすると、同じエラーメッセージが再度表示されます。
ErrorException in Logger.php line 38:
Required @SWG\Info() not found
in Logger.php line 38
at HandleExceptions->handleError('1024', 'Required @SWG\Info() not found', '/home/admin/api/gevme-api/vendor/zircote/swagger-php/src/Logger.php', '38', array('entry' => 'Required @SWG\Info() not found', 'type' => '1024'))
at trigger_error('Required @SWG\Info() not found', '1024') in Logger.php line 38
at Logger->Swagger\{closure}('Required @SWG\Info() not found', '1024')
at call_user_func(object(Closure), 'Required @SWG\Info() not found', '1024') in Logger.php line 68
at Logger::notice('Required @SWG\Info() not found') in AbstractAnnotation.php line 365
at AbstractAnnotation->validate() in Analysis.php line 284
at Analysis->validate() in functions.php line 46
at Swagger\scan('/home/admin/api/gevme-api/modules/Api', array('exclude' => array('/home/admin/api/gevme-api/storage', '/home/admin/api/gevme-api/tests', '/home/admin/api/gevme-api/resources/views', '/home/admin/api/gevme-api/config', '/home/admin/api/gevme-api/vendor'))) in routes.php line 39
at SwaggervelServiceProvider->{closure}()
at call_user_func_array(object(Closure), array()) in Route.php line 155
at Route->runCallable(object(Request)) in Route.php line 130
at Route->run(object(Request)) in Router.php line 704
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 706
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 671
at Router->dispatchToRoute(object(Request)) in Router.php line 631
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in OAuthExceptionHandlerMiddleware.php line 36
at OAuthExceptionHandlerMiddleware->handle(object(Request), object(Closure))
at call_user_func_array(array(object(OAuthExceptionHandlerMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
at require_once('/home/admin/api/gevme-api/public/index.php') in server.php line 21
私はDarkaOnLine/SwaggerLumeを使用してLumenフレームワークで同じエラーが発生しました。 このファイルはどこで編集できますか? –
Swaggerのドキュメントを置く場所はどこにでもあります。通常、手動で作成する必要があります。私はルーメンについては知らない。 – Mathew
@AhmedZelfaniあなたはこれをどのように修正しましたか? – user269867