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

rest-dsl - Allow to turn off vendor extension... NPE

    XMLWordPrintableJSON

Details

    • Patch Available
    • Unknown

    Description

      CAMEL-11957 introduced a NPE as org.apache.camel.swagger.servlet.RestSwaggerServlet calls (RestSwaggerSupport).renderResourceListing (line 192) passing null is the value for configuration.

      RestSwaggerSupport.renderResourceListing utilizes the configuration argument without checking for null. (Or you could pass in a non-null configuration from RestSwaggerServlet.

      Patch:

      diff --git a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java
      index 7bd53aa..5a5184d 100644
      --- a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java
      +++ b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java
      @@ -212,7 +212,8 @@
                       // read the rest-dsl into swagger model
                       Swagger swagger = reader.read(rests, route, swaggerConfig, contextId, classResolver);
       
      -                if (!configuration.isApiVendorExtension()) {
      +                //Fix for CAMEL-11957
      +                if (configuration != null && !configuration.isApiVendorExtension()) {
                           clearVendorExtensions(swagger);
                       }
       
      @@ -231,7 +232,8 @@
                       // read the rest-dsl into swagger model
                       Swagger swagger = reader.read(rests, route, swaggerConfig, contextId, classResolver);
       
      -                if (!configuration.isApiVendorExtension()) {
      +                //Fix for CAMEL-11957
      +                if (configuration != null && !configuration.isApiVendorExtension()) {
                           clearVendorExtensions(swagger);
                       }
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            jeff.domeyer Jeff Domeyer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: