You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/08/31 11:03:00 UTC
[jira] [Resolved] (CAMEL-16904) Camel Swagger API response message
headers of type string generate an empty enum even when allowableValues are
not specified.
[ https://issues.apache.org/jira/browse/CAMEL-16904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-16904.
---------------------------------
Fix Version/s: 3.11.2
Resolution: Fixed
Thanks for reporting and the PR
> Camel Swagger API response message headers of type string generate an empty 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.1, 3.11.0
> Reporter: Avinash Dongre
> Priority: Major
> Fix For: 3.11.2, 3.12.0
>
> Attachments: empty_enum.png
>
>
> 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)