Dmitry created CXF-9051:
---------------------------

             Summary: SwaggerUI broken after migrate from 
                 Key: CXF-9051
                 URL: https://issues.apache.org/jira/browse/CXF-9051
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 4.0.5
         Environment: @Configuration
public class SwaggerConfiguration {

@Bean
public OpenApiFeature swaggerFeature() {
OpenApiFeature swagger = new OpenApiFeature();
swagger.setVersion("1.0.0");
//swagger.setBasePath("/");
swagger.setPrettyPrint(true);
//swagger.setSchemes(new String[]\{"https", "http"});
swagger.setContactEmail("[email protected]");
swagger.setDescription("Swagger cxf app");
swagger.setTitle("Title");
swagger.setSupportSwaggerUi(true);
swagger.setSwaggerUiConfig(new SwaggerUiConfig().configUrl("/openapi.json"));
//swagger.setHost("localhost:8080");
System.out.println("http://localhost:8080/api-docs?url=/openapi.json";);
return swagger;
}

// @Bean
// public Server jaxRsServer(Bus bus, UserController userController) {
// final JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
//
// factory.setServiceBean(userController);
// factory.setProvider(new JacksonJsonProvider());
// factory.setFeatures(Arrays.asList(swaggerFeature()));
// factory.setBus(bus);
// factory.setAddress("/");
// return factory.create();
// }

}
            Reporter: Dmitry
         Attachments: image-2024-09-06-16-59-13-761.png, 
image-2024-09-06-17-01-05-729.png

I'm upgrading spring boot in my project from 2.7 to 3.0.0
So changed
cxf-rt-rs-service-description-swagger -> 
cxf-rt-rs-service-description-openapi-v3
After that I try just replace Swagger2Feature to OpenApiFuture and swagger-ui 
doesn't show my controllers and models anymore("No operations defined in spec").
Manual creating of cxf.endpoint.Server bean also didnt help me.
What I do wrong?

[https://github.com/romanov93/cxf-migtaion/blob/master/src/main/java/com/example/cxfmigration/SwaggerConfiguration.java]

Spring Boot 2.7.18 and Swagger2Feature:
!image-2024-09-06-16-59-13-761.png!

Spring Boot 3.0.0 and OpenApiFeature:
!image-2024-09-06-17-01-05-729.png!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to