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

Camel Swagger API response message headers of type string generate an empty enum even when allowableValues are not specified.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • fuse-7.10-GA
    • fuse-7.9-GA
    • Camel
    • None
    • False
    • False
    • % %
    • +
    • Automated

      Response message headers are configured like so 

      rest().get("/test") 
      .responseMessage().code(200).header("header1").description("test_header")
      .endHeader().endResponseMessage() .to("log:log1?showBody=true");
      
      

       But there is an empty enum in the resulting API doc that generates an error if parsed on swagger's online editor.

      {
        "swagger" : "2.0",
        "info" : {
          "version" : "1.0",
          "title" : "Test API"
        },
        "host" : "localhost:8080",
        "basePath" : "/rest",
        "schemes" : [ "http" ],
        "paths" : {
          "/test" : {
            "get" : {
              "operationId" : "verb1",
              "responses" : {
                "200" : {
                  "description" : "success",
                  "headers" : {
                    "header1" : {
                      "type" : "string",
                      "description" : "test_header",
                      "enum" : [ ]
                    }
                  }
                }
              }
            }
          }
        }
      }
      

      This doesn't happen with other data types.

              yfang@redhat.com Freeman(Yue) Fang
              rhn-support-adongre Avinash Dongre
              Federico Mariani Federico Mariani
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: