[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16924971#comment-16924971 ] Andriy Redko commented on CXF-8103: --- Hey [~kkurucz] , a bit more details popped up recently, so Swagger introduced the property which allows to specify scanner class, we've added the support for it in *OpenApiFeature* as well (*scannerClass* property). For your case, it would be (to use application-defined classes only): {code:java} feature.setScannerClass("io.swagger.v3.jaxrs2.integration.JaxrsApplicationScanner");{code} The workaround with *resourcePackages* would not be required anymore. With that, we may not need to wait for *2.0.10* to come out, and next CXF release train will bring these changes in. Thanks. Best Regards, Andriy Redko > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Assignee: Andriy Redko >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16922433#comment-16922433 ] Krisztian Kurucz commented on CXF-8103: --- Perfect! Thanks! :) > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Assignee: Andriy Redko >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16922427#comment-16922427 ] Andriy Redko commented on CXF-8103: --- Thanks [~kkurucz] , we are not supposed to make changes in CXF, just update the dependency, I have created the linked ticket for that. > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Assignee: Andriy Redko >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16922422#comment-16922422 ] Krisztian Kurucz commented on CXF-8103: --- would it be better to close after the fix will be released? -krisz > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Assignee: Andriy Redko >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16922418#comment-16922418 ] Andriy Redko commented on CXF-8103: --- The fix is coming in Swagger Core 2.0.10, I am closing this issue for now since we have a workaround for the time being. > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Assignee: Andriy Redko >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16922276#comment-16922276 ] Krisztian Kurucz commented on CXF-8103: --- Thank you for your help! I choose Option1 :) > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Assignee: Andriy Redko >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16921795#comment-16921795 ] Andriy Redko commented on CXF-8103: --- Send the PR to Swagger Core: https://github.com/swagger-api/swagger-core/pull/3283 > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Assignee: Andriy Redko >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16921755#comment-16921755 ] Andriy Redko commented on CXF-8103: --- Hi [~kkurucz] , So we've clear picture now what is the issue. Indeed it was caused by changes in Swagger, which basically **always** scans the classpath if *resourcePackages* or *resourceClasses* are not specified (your case). So there are 2 ways to overcome this behavior: # Add the any package to *OpenApiFeature*, for example {code:java} feature.setResourceClasses(Collections.singleton("*")); {code} In this case, the classes will be properly picked up from *Application* instances. # Explicitly set the classes to scan but in this case you cannot used generic bean and have to add the feature instance manually, for example: {code:java} @Bean public Server sampleServer(Bus bus) { final JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean(); endpoint.setBus(bus); endpoint.setAddress("/api"); endpoint.setServiceBean(new Sample()); final OpenApiFeature feature = new OpenApiFeature(); feature.setScan(false); feature.setUseContextBasedConfig(true); feature.setSwaggerUiConfig(new SwaggerUiConfig().url("openapi.json")); feature.setResourceClasses(Collections.singleton(Sample.class.getName())); endpoint.getFeatures().add(feature); return endpoint.create(); } @Bean public Server sample2Server(Bus bus) { final JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean(); endpoint.setBus(bus); endpoint.setAddress("/api2"); endpoint.setServiceBean(new Sample2()); final OpenApiFeature feature = new OpenApiFeature(); feature.setScan(false); feature.setUseContextBasedConfig(true); feature.setSwaggerUiConfig(new SwaggerUiConfig().url("openapi.json")); feature.setResourceClasses(Collections.singleton(Sample2.class.getName())); endpoint.getFeatures().add(feature); return endpoint.create(); } {code} In this case you don't need *FeatureConfiguration* class anymore. This is what we have at the moment. Best Regards, Andriy Redko > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Assignee: Andriy Redko >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16920782#comment-16920782 ] Krisztian Kurucz commented on CXF-8103: --- hi, thanks, i will give it a try -krisz > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Assignee: Andriy Redko >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16919872#comment-16919872 ] Andriy Redko commented on CXF-8103: --- Hi [~kkurucz], It looks like the regression caused by recent Swagger versions, we'll be looking into it, but the workaround for now would be to downgrade it to *2.0.6* (if it helps in your situation): {noformat} io.swagger.core.v3 swagger-core 2.0.6 io.swagger.core.v3 swagger-jaxrs2 2.0.6 {noformat} Thank you for submitting the issue. Best Regards, Andriy Redko > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16919386#comment-16919386 ] Krisztian Kurucz commented on CXF-8103: --- Hi [~reta], Attached the SpringBoot Demo application. [http://localhost:8080/services/api/api-docs?url=openapi.json] [http://localhost:8080/services/api2/api-docs?url=openapi.json|http://localhost:8080/services/api/api-docs?url=openapi.json] Please try it with the below CXF versions: * 3.3.2 ** "/api" openapi.json will contain only "/api" endpoint-related descriptions ** "/api2" openapi.json will contain only "/api2" endpoint-related descriptions * 3.3.3 ** "/api" openapi.json will contain "/api" and "/api2" endpoint-related descriptions ** "/api2" openapi.json will contain "/api" and "/api2" endpoint-related descriptions -Krisz > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Priority: Major > Attachments: description_openapi_v3_spring_boot.7z > > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (CXF-8103) OpenApiFeature - cannot use useContextBasedConfig
[ https://issues.apache.org/jira/browse/CXF-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16919024#comment-16919024 ] Andriy Redko commented on CXF-8103: --- Hi [~kkurucz] , Could you please attach the sample project to reproduce the issue. Thank you. Best Regards, Andriy Redko > OpenApiFeature - cannot use useContextBasedConfig > - > > Key: CXF-8103 > URL: https://issues.apache.org/jira/browse/CXF-8103 > Project: CXF > Issue Type: Bug > Components: JAX-RS, Services >Affects Versions: 3.3.3 >Reporter: Krisztian Kurucz >Priority: Major > > In case of Using Multiple Server Endpoints all openapi.json will contain all > resource descriptions -- This message was sent by Atlassian Jira (v8.3.2#803003)