Migration from org.apache.cxf.jaxrs.swagger -> org.apache.cxf.jaxrs.openapi

After up Spring Boot to version 3 I try to migrate from Swagger to OpenAPI.
Project depends on Apache CXF.
How can I rewrite the swagger configuration?

It was before OpenApi:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>@Configuration
public class SwaggerConfiguration {
@Bean
public Swagger2Feature swagger2Feature() {
Swagger2Feature swagger = new Swagger2Feature();
swagger.setVersion(*version*);
swagger.setBasePath(*basePath*);
swagger.setPrettyPrint(true);
swagger.setSchemes(new String[]{"https", "http"});
swagger.setContact(*contact*);
swagger.setDescription(*description*);
swagger.setTitle(*title*);
swagger.setSupportSwaggerUi(true);
swagger.setHost(*host*);
return swagger;
}
}
</code>
<code>@Configuration public class SwaggerConfiguration { @Bean public Swagger2Feature swagger2Feature() { Swagger2Feature swagger = new Swagger2Feature(); swagger.setVersion(*version*); swagger.setBasePath(*basePath*); swagger.setPrettyPrint(true); swagger.setSchemes(new String[]{"https", "http"}); swagger.setContact(*contact*); swagger.setDescription(*description*); swagger.setTitle(*title*); swagger.setSupportSwaggerUi(true); swagger.setHost(*host*); return swagger; } } </code>
@Configuration
public class SwaggerConfiguration {
@Bean
    public Swagger2Feature swagger2Feature() {
        Swagger2Feature swagger = new Swagger2Feature();
        swagger.setVersion(*version*);
        swagger.setBasePath(*basePath*);
        swagger.setPrettyPrint(true);
        swagger.setSchemes(new String[]{"https", "http"});
        swagger.setContact(*contact*);
        swagger.setDescription(*description*);
        swagger.setTitle(*title*);
        swagger.setSupportSwaggerUi(true);
        swagger.setHost(*host*);
        return swagger;
    }
}

I try just replace Swagger2Feature to OpenApiFeature but swagger ui does not open after it.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>@Bean
public OpenApiFeature openApiFeature() {
OpenApiFeature openApi = new OpenApiFeature();
openApi.setVersion(*version*);
openApi.setPrettyPrint(true);
openApi.setContactEmail(*email*);
openApi.setDescription(*description*);
openApi.setTitle(*title*);
openApi.setSupportSwaggerUi(true);
openApi.setSwaggerUiConfig(
new SwaggerUiConfig()
.url("/openapi.json"));
return openApi;
}
</code>
<code>@Bean public OpenApiFeature openApiFeature() { OpenApiFeature openApi = new OpenApiFeature(); openApi.setVersion(*version*); openApi.setPrettyPrint(true); openApi.setContactEmail(*email*); openApi.setDescription(*description*); openApi.setTitle(*title*); openApi.setSupportSwaggerUi(true); openApi.setSwaggerUiConfig( new SwaggerUiConfig() .url("/openapi.json")); return openApi; } </code>
@Bean
    public OpenApiFeature openApiFeature() {
        OpenApiFeature openApi = new OpenApiFeature();
        openApi.setVersion(*version*);
        openApi.setPrettyPrint(true);
        openApi.setContactEmail(*email*);
        openApi.setDescription(*description*);
        openApi.setTitle(*title*);
        openApi.setSupportSwaggerUi(true);
        openApi.setSwaggerUiConfig(
            new SwaggerUiConfig()
                .url("/openapi.json"));
        return openApi;
    }

0

Solution: just replace @Path annotation from interface to impl.
Jaxrs with openapi dont see controller if @Path annotation not on class.

Example:

Will not work:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> @Path(/some)
interface ExampleController{}
class ExampleControllerImpl implements ExampleController{}
</code>
<code> @Path(/some) interface ExampleController{} class ExampleControllerImpl implements ExampleController{} </code>
    @Path(/some)
    interface ExampleController{}
    class ExampleControllerImpl implements ExampleController{}

should work:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> interface ExampleController{}
@Path(/some)
class ExampleControllerImpl implements ExampleController{}
</code>
<code> interface ExampleController{} @Path(/some) class ExampleControllerImpl implements ExampleController{} </code>
    interface ExampleController{}
    @Path(/some)
    class ExampleControllerImpl implements ExampleController{}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật