cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Concombre Masqué (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CXF-7117) Swagger2Feature not working in OSGi container when jaxrs server address not attached to CXF servlet
Date Tue, 15 Nov 2016 09:11:58 GMT

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

Concombre Masqué commented on CXF-7117:
---------------------------------------

Hi Andriy,

Thank you for your effort on this issue. Yes, after my own investigation, I have figured out
that ServletConfig is required to make Swagger2Feature work as expected.
Using "scan" does not help in fact since I always have to deploy several bundles with JAX-RS
servers. And I think my use case is not an exception. As a result Swagger2Feature seems to
be of no use in an OSGi environment.

Do you think it is possible to instantiate a ServletConfig object and provide it to Swagger2Feature
(by exposing a dedicated setter) to solve the problem?

Many thanks.

> 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é
>            Assignee: Andriy Redko
>
> 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)

Mime
View raw message