You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Avinash Dongre (Jira)" <ji...@apache.org> on 2021/08/31 08:59:00 UTC

[jira] [Created] (CAMEL-16904) Camel Swagger API response message headers of type string generate an emty enum even when allowableValues are not specified.

Avinash Dongre created CAMEL-16904:
--------------------------------------

             Summary: Camel Swagger API response message headers of type string generate an emty enum even when allowableValues are not specified.
                 Key: CAMEL-16904
                 URL: https://issues.apache.org/jira/browse/CAMEL-16904
             Project: Camel
          Issue Type: Bug
          Components: camel-swagger-java
    Affects Versions: 3.11.0, 3.11.1
            Reporter: Avinash Dongre
             Fix For: 3.12.0


Response message headers are configured like so 
{code:java}
rest().get("/test") 
.responseMessage().code(200).header("header1").description("test_header")
.endHeader().endResponseMessage() .to("log:log1?showBody=true");

{code}
 But there is an empty enum in the resulting API doc that generates an error if parsed on swagger's online [editor. |https://editor.swagger.io/]
{code:java}
{
  "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" : [ ]
              }
            }
          }
        }
      }
    }
  }
}
{code}

This doesn't happen with other data types.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)