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

camel-restdsl-swagger-plugin doesn't convert integer default value to string

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.21.0
    • Fix Version/s: 2.21.3, 2.22.2, 2.23.0
    • Component/s: tooling
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      When generating a RouteBuilder from a swagger that defines default parameter values of type integer, there is no conversion to a string when setting it:

      Swagger:

      "limit":

      { "name":"limit", "in":"query", "type":"integer", "minimum":1, "default":20, "description":"the limit of the results for the collections query" }

      ,

      RouteBuilder:

      .param()
      .name("limit")
      .type(RestParamType.query)
      .dataType("integer")
      .defaultValue(20)
      .required(false)
      .description("the limit of the results for the collections query")
      .endParam()

      defaultValue only accepts parameters of type string and therefore the generated code can't be compiled and needs to be corrected manually.

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              jcordes Jochen Cordes
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: