You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2016/11/07 13:32:58 UTC

[jira] [Comment Edited] (CXF-7117) Swagger2Feature not working in OSGi container when jaxrs server address not attached to CXF servlet

    [ https://issues.apache.org/jira/browse/CXF-7117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15644183#comment-15644183 ] 

Sergey Beryozkin edited comment on CXF-7117 at 11/7/16 1:32 PM:
----------------------------------------------------------------

Hi Andriy

As far as I recall, Swagger will still scan even if a 'scan' property is disabled which is not a 'problem' when a single endpoint is available - Swagger2Feature will still provide a JAX-RS Application info to Swagger if the 'scan' is disabled which helps, especially in OSGI, to resolve various things.
If we have more than one endpoint in the context, with each endpoint having an absolute address, then these two endpoints are completely independent and I really do not see how to tell Swagger not to mix things up. 
I wonder, if we can somehow install a JAXRS Reflections handler into Swagger if 'scan' is disabled. I recall @splatch saw some issues with Swagger not loading  JAXRS Reflections handler in time, or something like that, Lukasz, can you remind please ?

Thanks, Sergey


was (Author: sergey_beryozkin):
Hi Andriy

As far as I recall, Swagger will still scan even if a 'scan' property is disabled which is not a 'problem' when a single endpoint is available - Swagger2Feature will still provide a JAX-RS Application info to Swagger if the 'scan' is disabled which helps, especially in OSGI, to resolve various things.
If we have more than one endpoint in the context, with each endpoint having an absolute address, then these tewo endpoints are completely independent and I really do not see how to tell Swagger not to mix things up. 
I wonder, if we can somehow install a JAXRS Reflections handler into Swagger if 'scan' is disabled. I recall @splatch saw some issues with Swagger not loading  JAXRS Reflections handler in time, or something like that, Lukasz, can you remind please ?

Thanks, Sergey

> Swagger2Feature not working in OSGi container when jaxrs server address not attached to CXF servlet
> ---------------------------------------------------------------------------------------------------
>
>                 Key: CXF-7117
>                 URL: https://issues.apache.org/jira/browse/CXF-7117
>             Project: CXF
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 3.1.8
>         Environment: Apache Karaf 3.0.8
>            Reporter: Concombre Masqué
>
> Just modify sample description_swagger2_osgi as follows:
>     <!-- CXF Swagger2Feature -->  
>     <bean id="swagger2Feature" class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>         <property name="basePath" value="/test/swaggerSample"/>
>         <property name="usePathBasedConfig" value="true" />
>     </bean>
>     <cxf:bus>
>         <cxf:features>
>             <cxf:logging />
>         </cxf:features>
>     </cxf:bus>
>     <jaxrs:server id="sampleServer" address="http://localhost:9091/test/swaggerSample">
>         <jaxrs:serviceBeans>
>             <ref component-id="sampleResource" />
>         </jaxrs:serviceBeans>
>         <jaxrs:providers>
>             <ref component-id="jsonProvider" />
>             <ref component-id="multipartProvider" />
>             <ref component-id="originFilter" />
>         </jaxrs:providers>
>         <jaxrs:features>
>             <ref component-id="swagger2Feature" />
>         </jaxrs:features>
>     </jaxrs:server>
> Then deploy modified bundle into Karaf and browse Swagger service definition at http://localhost:9091/test/swaggerSample/swagger.json
> Result is:
> {"swagger":"2.0"}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)