我正在使用Apache CXF构建Spring Boot应用程序。在尝试添加摇摇欲坠时,我没有在规范中定义任何操作!错误,尽管我通过注释1-2操作指定了。
Swagger的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;
    }


我认为功能设置不正确。我缺少什么?
api-docs的链接是这样的:http://localhost:8080/cxf/todo_list/api-docs?url=/cxf/todo_list/swagger.json

在用户界面页面的浏览字段中:/cxf/todo_list/swagger.json

最佳答案

我已经解决了问题。我忘了将@Path注释放入我的REST服务中。我做完之后,大张旗鼓地开始工作。我唯一不了解的-如何摆脱默认标签

10-08 00:46