Łukasz Dywicki created CXF-7009:
-----------------------------------

             Summary: 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 a 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)

Reply via email to