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

Swagger prints child object types as string parameters rather than refs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.18.0
    • 2.17.5, 2.18.2, 2.19.0
    • camel-swagger
    • None
    • Patch Available
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: