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

camel-restdsl-openapi-plugin - generate operationId enumeration

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.7.2
    • 3.x
    • tooling
    • None
    • Unknown

    Description

      Hi,

      I discovered this great tool (camel-restdsl-openapi-plugin) two days ago.

      It's almost perfect. I have only one suggestion for improvement:

      Actually the plugin is generating "controller" like class with code similar to:

      rest()
          .get("/somepath")
              .id("operationIdFromOpenAPI")
              .produces("application/json")
              .to("direct:operationIdFromOpenAPI");
      

      And "user" can continue route with:

      from(direct:operationIdFromOpenAPI)...
      

       

      Problem:

      The problem occurs during the change operationId in next version of OpenAPI definition. It have to be manually checked.

       

      Improvement:

      It would be very nice if the plugin generated an enum of operationIds from the OpenAPI definition. Something like:

      public enum ApiOperation {
        OPERATION_ID_1("operationId1"),
        ANOTHER_OPERATION_ID("anotherOperationId");
      
        private final String value;
      
      // ... constructor, toString...

       

      And route with:

      ...to("direct:" + ApiOperation.OPERATION_ID_1);
      

      With best regards

      Vladimir

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            vlavasa Vladimír Váša
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: