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

CXF Swagger Contexts Mixed when Multiple Services are Deployed

XMLWordPrintable

    • % %
    • Hide

      Deploy and start the attached customer service and greeter service bundles on Fuse 6.2.1 R2 Karaf instance.

      Navigate to the two api-docs endpoints:

      http://localhost:8181/cxf/greet/api-docs
      http://localhost:8181/cxf/customer/api-docs
      

      Note that the JSON output for the second service is mingled with elements from the first.

      Optional: install feature fabric-hawtio-swagger and open the endpoints in swagger-ui. Note that both services display the same API.

      Show
      Deploy and start the attached customer service and greeter service bundles on Fuse 6.2.1 R2 Karaf instance. Navigate to the two api-docs endpoints: http: //localhost:8181/cxf/greet/api-docs http: //localhost:8181/cxf/customer/api-docs Note that the JSON output for the second service is mingled with elements from the first. Optional: install feature fabric-hawtio-swagger and open the endpoints in swagger-ui. Note that both services display the same API.
    • 7.0 Sprint 1

      When deploying multiple bundles exposing swagger-annotated services, API documentation for the services are mixed. SwaggerFeature is defined as a child element for the cxf:rsServer in each case, and serlet contextual URLs are different - like http://localhost:8181/cxf/greet and http://localhost/cxf/customer.

      It appears that the second service deployed gets the @Path from the first. In the example below, the first service deployed was the customer service:

      {"apiVersion":"4.0","swaggerVersion":"1.2","apis":[{"path":"/customerservice","description":"Simple Spring JAX-RS Customer Service with Swagger documentation"}],"info":{"title":"Red Hat :: Demo - Customer Service","description":"Sample REST-based Customer Service","contact":"committer@apache.org","license":"Apache 2.0 License","licenseUrl":"http://www.apache.org/licenses/LICENSE-2.0.html"}}
      

      Then the greeter service:

      {"apiVersion":"4.0","swaggerVersion":"1.2","apis":[{"path":"/customerservice","description":"Simple Spring JAX-RS Customer Service with Swagger documentation"}],"info":{"title":"Red Hat :: Example - Greeting Service","description":"Sample REST-based Greeting Service","contact":"committer@apache.org","license":"Apache 2.0 License","licenseUrl":"http://www.apache.org/licenses/LICENSE-2.0.html"}}
      

      The API description is correct, but not that the path points to the customer service. Opening the APIs in swagger-ui displays the customer service operations for both services. Flipping the deployment order, results in the reverse - both display the greeter API.

            johnpoth John Poth
            rhn-support-dhawkins Duane Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: