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

camel-restdsl-openapi-plugin - generate operationId enumeration

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.2
    • Fix Version/s: 3.x
    • Component/s: tooling
    • Labels:
      None
    • Estimated Complexity:
      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

            • Assignee:
              Unassigned
              Reporter:
              vlavasa Vladimír Váša
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: