[ https://issues.apache.org/jira/browse/CXF-7009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15418706#comment-15418706 ]
Sergey Beryozkin commented on CXF-7009: --------------------------------------- Hey Łukasz, So is it correct, based on your analysis, that even if Swagger2Feature does some extra work on calculating the resource packages, it will still not work under OSGI ? I guess it does not matter if Swagger2Feature itself calculates it or it is passed as a set as a Swagger2Feature property Thanks, Sergey > Swagger feature ignore interfaces under OSGi > -------------------------------------------- > > Key: CXF-7009 > URL: https://issues.apache.org/jira/browse/CXF-7009 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 3.1.7 > Environment: Karaf 4.0.5 > Reporter: Łukasz Dywicki > > When more advanced structuring in project is used cxf swagger intergration > fails to generate proper swagger service descriptor (while it still works for > wadl). > For example: > {code:lang=java|title=SampleResource.java} > package org.code_house.swagger.example.api; > @Api > @Path("/test") > public interface SampleResource { > @GET > @ApiOperation("Something to do") > String getSomething(); > } > {code} > {code:lang=java|title=DefaultSampleResource.java} > package org.code_house.swagger.example.core.internal; > import org.code_house.swagger.example.api.SampleResource; > public class DefaultSampleResource implements SampleResource { > public String getSomething() { > return "aaa"; > } > } > {code} > Works properly, however there is no way to get Swagger2 feature picking this > up. From my analysis it seems that default package calculation uses just > package names of resources defined in class (impl classes) and ignores > implemented interfaces. > Passing to Swagger2Feature an valid package name which contains interfaces is > not working as well because it resources are not visible from implementation > bundle. This is side effect of the Swagger resource scanning logic where it > query classloader for resources. This gets forwarded to CXF's > BundleDelegatingClassLoader and then to bundle which is not aware of any > resources from packages different than it's own. -- This message was sent by Atlassian JIRA (v6.3.4#6332)