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

Response message definition does not correctly handle java.io.File as response model

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Novice

    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:

       

      "responses" : {
        "200" : {
          "description" : "Created PDF file",
          "schema" : {
            "type" : "string",
            "format" : "java.io.File"
          },
        },
        // ....
      }
      
      
      

       The correct way to handle this according to Swagger docs v2 (https://swagger.io/docs/specification/2-0/describing-responses/) is:

      "responses" : {
        "200" : {
          "description" : "Created PDF file",
          "schema" : {
            "type" : "file"
          },
        },
        // ....
      }
      

       
      camel-openapi-java with OAS2 / OAS3 is also affected.
       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            eidottermihi Michael Prankl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment