2017-10-01 2 views
0

Apache CXFでSpring起動アプリケーションを構築しています。私は仕様に定義されていない操作を取得swaggerを追加しようとしている間!エラーですが、私は注釈1〜2のオペレーションで指定しました。 闊歩ためCXFの設定の一部は以下の通りです: Swagger UIとCXF仕様に定義されている操作がありません

factory.setFeatures(Collections.singletonList(createSwaggerFeature())); 

public Swagger2Feature createSwaggerFeature() { 
     Swagger2Feature swagger2Feature = new Swagger2Feature(); 
     swagger2Feature.setPrettyPrint(true); 
     swagger2Feature.setSupportSwaggerUi(true); 
     swagger2Feature.setScanAllResources(true); 
     swagger2Feature.setHost("localhost:8080"); 
     swagger2Feature.setBasePath("/cxf/todo_list"); 
     swagger2Feature.setTitle("TodoList Application"); 
     swagger2Feature.setContact("https://www.github/abondar24"); 
     swagger2Feature.setDescription("Another TodoList application with Spring Boot and Swagger"); 
     swagger2Feature.setVersion("1.0.0"); 
     return swagger2Feature; 
    } 

私は機能がcorrectly.Whatは、私が行方不明です設定されていないと考えていますか? API-ドキュメントへのリンクは、このようなものです: http://localhost:8080/cxf/todo_list/api-docs?url=/cxf/todo_list/swagger.json

では、UIページ上のフィールドを探索:

+0

コードをどこかで利用できるようにすることはできますか?これまでのところ私は何のエラーも見ません。また、実際のサンプルと比較することもできます:https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_swagger2 –

答えて

0

/cxf/todo_list/swagger.json私は、問題を解決しました。 @PathアノテーションをRESTサービスに入れるのを忘れてしまった。私はそれをした後swaggerは働き始めた。私が理解できない唯一のこと - デフォルトのタグを取り除く方法

関連する問題