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

Swagger REST API details are not bundle-specific

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jboss-fuse-6.2
    • jboss-fuse-6.1
    • Karaf
    • None
    • % %
    • Hide

      1. In a clean install of JBoss Fuse, features:install swagger; features:install cxf-jaxrs
      2. Unpack, build and deploy the two attached projects – rest_prj.rar and rest2_prj.rar.
      3. Install the generated bundles rest.jar and rest2.jar
      4. See that the two bundles are providing REST APIs independently by invoking their service URLs from a browser:

      http://localhost:8181/cxf/rest/restcustomer/customers/1
      http://localhost:8181/cxf/rest2/resttwocustomer/customers/1

      Note that the two outputs are different (compare with the slightly different source code in each test application).

      5. Request the api-docs interface:

      http://localhost:8181/cxf/rest/api-docs
      http://localhost:8181/cxf/rest2/api-docs

      Note that although the URLs are different, and correspond to the service URLs that behaved correctly, the API details returned in each request are the same (Again, compare the source code, to see that they should be different). The response to a request on api-docs is dependent on which bundle was loaded first.

      Show
      1. In a clean install of JBoss Fuse, features:install swagger; features:install cxf-jaxrs 2. Unpack, build and deploy the two attached projects – rest_prj.rar and rest2_prj.rar. 3. Install the generated bundles rest.jar and rest2.jar 4. See that the two bundles are providing REST APIs independently by invoking their service URLs from a browser: http://localhost:8181/cxf/rest/restcustomer/customers/1 http://localhost:8181/cxf/rest2/resttwocustomer/customers/1 Note that the two outputs are different (compare with the slightly different source code in each test application). 5. Request the api-docs interface: http://localhost:8181/cxf/rest/api-docs http://localhost:8181/cxf/rest2/api-docs Note that although the URLs are different, and correspond to the service URLs that behaved correctly, the API details returned in each request are the same (Again, compare the source code, to see that they should be different). The response to a request on api-docs is dependent on which bundle was loaded first.

    Description

      Details of a REST service provided by an application that uses Swagger can be obtained by making a request on the 'api-docs' URL for the particular service. When Swagger is used in the form of a ServiceMix OSGi bundle, however, the response to a request on api-docs comes from only one OSGi bundle, regardless of the number of bundles that provide services, and even though the URL used denotes a specific service. It appears that REST API information is being maintained at a per-JVM level, rather than a per-bundle level.

      Attachments

        1. rest_prj.rar
          8 kB
          Kevin Boone
        2. rest2_prj.rar
          9 kB
          Kevin Boone

        Issue Links

          Activity

            People

              yfang@redhat.com Freeman(Yue) Fang
              rhn-support-kboone Kevin Boone
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: