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

camel-restdsl-openapi-plugin - Add type and outType to Rest DSL

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.20.3, 4.0-M2
    • 4.5.0
    • rest, tooling
    • None
    • Unknown

    Description

      If camel-restdsl-openapi-plugin is used to generate DTOs, it would be nice to have type(..) and outType(..) set on the Rest DSL.

      ex.

      rest("/v2")
                  .put("/pet")
                      .id("updatePet")
                      .consumes("application/json,application/xml")
                      .produces("application/xml,application/json")
                      _.type(Pet.class)_
                      .param()
                          .name("body")
                          .type(RestParamType.body)
                          .required(true)
                          .description("Pet object that needs to be added to the store")
                      .endParam()
                      .to("direct:updatePet")
      

      given

      ...
      "/pet": {
                  "put": {
                      "requestBody": {
                          "description": "Pet object that needs to be added to the store",
                          "content": {
                              "application/json": {
                                  "schema": {
                                      "$ref": "#/components/schemas/Pet"
                                  }
                              },
      ...
      

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              Federico Mariani Federico Mariani
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: