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

Swagger prints child object types as string parameters rather than refs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.18.0
    • Fix Version/s: 2.17.5, 2.18.2, 2.19.0
    • Component/s: camel-swagger
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      Assume I have rest path

      rest("/test").get().type(ClassA.class).to("direct:someRoute");
      
      rest("/testSub").get().type(ClassB.class).to("direct:someOtherRoute");
      

      And in the type ClassA contains a reference to ClassB.

      Within the Swagger Doc the path for ClassA renders as expected:

      /test:
          get:
            responses:
              200:
                schema:
                  $ref: '#/definitions/ClassA'
      

      However ClassB gets a string parameter scheme

       
      /testSub:
          get:
            responses:
              200:
                schema:
                   type : 'string'
                   format : 'com.ClassB'
      

      However I'd expect it to be:

      /testSub:
          get:
            responses:
              200:
                schema:
                  $ref: '#/definitions/ClassB'
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                bobpaulin Bob Paulin
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: