[
https://issues.apache.org/jira/browse/CAMEL-15919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Prankl updated CAMEL-15919:
-----------------------------------
Component/s: camel-openapi-java
Description:
Currently, specifying "java.io.File" class as response model (for example when
the API returns a binary document, aka "Download") in
RestOperationResponseMsgDefinition produces an incorrect Swagger / OAS2 / OAS3
definition:
{noformat}
"responses" : {
"200" : {
"description" : "Created PDF file",
"schema" : {
"type" : "string",
"format" : "java.io.File"
},
},
// ....
}
{noformat}
The correct way to handle this according to Swagger docs v2
(https://swagger.io/docs/specification/2-0/describing-responses/) is:
{noformat}
"responses" : {
"200" : {
"description" : "Created PDF file",
"schema" : {
"type" : "file"
},
},
// ....
}
{noformat}
camel-openapi-java with OAS2 / OAS3 is also affected.
was:
Currently, specifying "java.io.File" class as response model (for example when
the API returns a binary document, aka "Download") in
RestOperationResponseMsgDefinition produces an incorrect swagger definition:
{noformat}
"responses" : {
"200" : {
"description" : "Created PDF file",
"schema" : {
"type" : "string",
"format" : "java.io.File"
},
},
// ....
}
{noformat}
The correct way to handle this according to Swagger docs v2
(https://swagger.io/docs/specification/2-0/describing-responses/) is:
{noformat}
"responses" : {
"200" : {
"description" : "Created PDF file",
"schema" : {
"type" : "file"
},
},
// ....
}
{noformat}
> Response message definition does not correctly handle java.io.File as
> response model
> ------------------------------------------------------------------------------------
>
> Key: CAMEL-15919
> URL: https://issues.apache.org/jira/browse/CAMEL-15919
> Project: Camel
> Issue Type: Bug
> Components: camel-openapi-java, camel-swagger-java
> Affects Versions: 3.6.0
> Reporter: Michael Prankl
> Priority: Major
>
> Currently, specifying "java.io.File" class as response model (for example
> when the API returns a binary document, aka "Download") in
> RestOperationResponseMsgDefinition produces an incorrect Swagger / OAS2 /
> OAS3 definition:
>
> {noformat}
> "responses" : {
> "200" : {
> "description" : "Created PDF file",
> "schema" : {
> "type" : "string",
> "format" : "java.io.File"
> },
> },
> // ....
> }
> {noformat}
> The correct way to handle this according to Swagger docs v2
> (https://swagger.io/docs/specification/2-0/describing-responses/) is:
> {noformat}
> "responses" : {
> "200" : {
> "description" : "Created PDF file",
> "schema" : {
> "type" : "file"
> },
> },
> // ....
> }
> {noformat}
>
> camel-openapi-java with OAS2 / OAS3 is also affected.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)