Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7092

Swagger2Feature tries to resolve swagger-ui resources with api-docs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1.7
    • 3.1.9, 3.2.0
    • JAX-RS
    • None
    • Spring Boot 1.4.1
      Swagger 2.2.2

    • Unknown

    Description

      Add Swagger2Feature for customization to the class annotated with @SpringBootApplication, e.g.:

         @Bean
         public Swagger2Feature swagger2Feature() {
            Swagger2Feature swagger2Feature = new Swagger2Feature();
            swagger2Feature.setPrettyPrint(true);
            swagger2Feature.setContact("person who knows the API");
      
            return swagger2Feature;
         }
      

      Open url for swagger UI in browser will fail with:

      Caused by: java.io.FileNotFoundException: JAR entry META-INF/resources/webjars/swagger-ui/2.2.2/api-docs/lib/swagger-oauth.js not found in /work/m2repository/org/webjars/swagger-ui/2.2.2/swagger-ui-2.2.2.jar
      	at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:142)
      	at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
      	at java.net.URL.openStream(URL.java:1045)
      	at org.apache.cxf.jaxrs.swagger.Swagger2Feature$SwaggerUIService.getResource(Swagger2Feature.java:298)
      	... 102 more
      

      Please note that it works correctly when the Swagger2Feature is auto-configured without customizations.

      Attachments

        1. cxf7092.png
          40 kB
          Sergey Beryozkin

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            deki Dennis Kieselhorst
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: