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

Specifying a responseModel in RestOperationResponseMsgDefinition not output in Swagger API

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.16.1
    • 2.16.2
    • camel-swagger
    • None
    • Unknown

    Description

      When I specify a responseModel in a rest responseMessage definition like so:

      rest().put("{accountNumber}")
        .responseMessage()
          .code(HttpURLConnection.HTTP_OK)
          .message("Account was successfully updated.")
          .responseModel(AccountDetails.class)
        .endResponseMessage()
        .to("direct:foo");
      

      I get the following Swagger API fragment:

      "responses": {
        "200": {
          "description": "Account was successfully updated."
        }
      }
      

      However, if I specify the response model as the outType instead, I get a fragment like this instead:

      "responses": {
        "200": {
          "description": "Account was successfully updated.",
          "schema": {
            "$ref": "#/definitions/AccountDetails"
          }
        }
      }
      

      Doing it the latter way means I can't specify different out types for different status codes. It's only added to the 200 status code as far as I can tell.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            mattsicker Matt Sicker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: