Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-7617

regression with /api-docs swagger in cxf jaxrs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.2.1, jboss-fuse-6.3
    • Fix Version/s: fuse-7.0
    • Component/s: CXF
    • Labels:
      None
    • Sprint:
      Fuse 7.0 Sprint 24

      Description

      • Fuse version: 6.2.1 R4 patch
      • Fuse version : 6.2.1 R9 patch.
      • Fuse 6.3

      I have attached an example of CXF SwaggerFeature, which displays different swagger ui api json,

      In R4:

      {"apiVersion":"1.0.0","swaggerVersion":"1.2","apis":[{"path":"/HelloWolrd"}],"info":{"title":" Sample Rest Application","description":"A Sample HelloWorld Application","contact":"esb_support","license":"Apache 2.0 License","licenseUrl":"http://www.apache.org/licenses/LICENSE-2.0.html"}}[
      

      In R9:

       
      {"apiVersion":"1.0.0","swaggerVersion":"1.2","info":{"title":"Sample Rest Application","description":"A Sample HelloWorld Application","contact":"esb_support","license":"Apache 2.0 License","licenseUrl":"http://www.apache.org/licenses/LICENSE-2.0.html"}}
      

      (Hit, http://localhost:10085/esm/api/v1/api-docs in the browser)

      In the above notice that, '"apis":[

      {"path":"/HelloWolrd"}

      ]' is missing to be displayed in R9 patch.

      One of the ways to i see from the code is to set the SwaggerFeature#runAsFilter property to true,

      <bean id="swaggerFeature" class="org.apache.cxf.jaxrs.swagger.SwaggerFeature">
      <property name="runAsFilter" value="true" />
      

      which runs the SwaggerContainerRequestFilter, populating the api-docs path.

      If i do this, i can see the results as expected similar to R4.

      The results are the same with Fuse 6.3 version of CXF as well inline what we see in 6.2.1 R9

      I wanted to understand :

      • runAsFilter existed in earlier CXF versions, however, WITHOUT explicitly defining that property, we were able to see the api-docs as i remember correctly. Why is this changed going into later CXF versions, or even in the latest CXF community codebase ?
      • Do we always need to have the runAsFilter set to 'true' to display 'apis' as above ?

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ffang Freeman(Yue) Fang
                Reporter:
                vrlgohel Viral Gohel
                Tester:
                Jan Kasztura
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: