Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12957

camel-cxf - Swagger/OpenAPI feature should not involve the Camel route

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.22.2
    • Fix Version/s: 3.0.0, 2.25.0
    • Component/s: camel-cxfrs
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Currently, when adding Swagger2Feature or OpenApiFeature to a CXFRS endpoint, the calls to the API descriptions go through the Camel route, ie. one has to implement an additional Camel route in order to make those features work.

      Using runAsFilter=false a call to
      http://localhost:8080/services/myCamelService/openapi.json
      results in a call of the Camel route with an operation "getOpenApi"

      http://localhost:8080/services/myCamelServive/api-docs?url=openapi.json
      results in call of the Camel route with an operation "getResource"

      Using runAsFilter=true the situation improves marginally:
      http://localhost:8080/services/myCamelService/openapi.json
      still results in a call of the Camel route with an operation "getOpenApi"

      http://localhost:8080/services/myCamelServive/api-docs?url=openapi.json
      at least now shows the Swagger UI page frame but still fails to load the actual service description since it again calls the Camel route with the "getOpenApi" operation.

      Supposedly that means the filter correctly intercepts the getResource call but not the getOpenApi call. It would be great if this worked out of the box. A custom implementation would still be possible by not running as a filter.

        Attachments

        1. camel-openapi-test.zip
          8 kB
          Jens Kleine-Herzbruch
        2. camel-openapi-test-swagger2feature.tar
          72 kB
          Freeman Yue Fang

          Issue Links

            Activity

              People

              • Assignee:
                ffang Freeman Yue Fang
                Reporter:
                jensgr@gmx.net Jens Kleine-Herzbruch
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: