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

Mike Kelly commented on CXF-8144:
---------------------------------

I'll see if I can come up with a minimal test case, but here's the dependencies 
I have declared, along with dependency-management to version 3.3.4 of CXF, and 
version 2.9.9.20190807 of the Jackson BOM POM:

{noformat}
    <dependencies>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-extension-search</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-service-description-openapi-v3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>swagger-ui</artifactId>
            <version>3.23.11</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>javax.persistence-api</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.10</version>
        </dependency>
        <!-- plus, some inter-project module dependencies -->
    </dependencies>
{noformat}

The Spring Boot config I have in place ({{application.yaml}}):

{noformat}
# Apache CXF (JAX-RS) Configuration
cxf:
  path: /api/v3
  jaxrs:
    component-scan: true
    classes-scan-packages: 
com.fasterxml.jackson.jaxrs.json,org.apache.cxf.jaxrs.ext.search,org.apache.cxf.jaxrs.openapi,org.apache.cxf.jaxrs.validation
{noformat}

And, I have a {{openapi-configuration.yaml}} file in my classpath (I think I 
found that {{/api-docs/\{resource\}}} showed up in the Swagger docs after I 
added this file, which was why I added the {{ignoredRoutes}}, but I'm not sure):

{noformat}
---
prettyPrint: true
ignoredRoutes:
  - '/api-docs/{resource}'
openAPI:
  info:
    title: EXAMPLE REST API
    version: '3.2.0'
    license:
      name: proprietary
{noformat}

> OpenAPI v3 Feature: duplicated "getOpenApi" methods
> ---------------------------------------------------
>
>                 Key: CXF-8144
>                 URL: https://issues.apache.org/jira/browse/CXF-8144
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.3.3, 3.3.4
>            Reporter: Mike Kelly
>            Priority: Minor
>
> Any calls to the OpenAPI documentation, as provided by the 
> {{cxf-rt-rs-service-description-openapi-v3}} artifact, cause this warning to 
> be logged:
> {noformat}
> 2019-11-05 16:48:43,551 [http-nio-8080-exec-9] WARN  
> org.apache.cxf.jaxrs.utils.JAXRSUtils  - Both 
> org.apache.cxf.jaxrs.swagger.ui.SwaggerUiService#getResource and 
> org.apache.cxf.jaxrs.swagger.ui.SwaggerUiService#getResource are equal 
> candidates for handling the current request which can lead to unpredictable 
> results
> {noformat}
> If you're loading or refreshing the API documentation, you'll see a whole lot 
> of these warnings get logged.
> This seems like something that is likely a spurious message, or a design flaw 
> in the Apache CXF modules?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to