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

camel route customized id isn't correct if there are more than one Rest DSL route availble

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.23.3, 2.24.1
    • 2.23.4, 2.24.2, 3.0.0.M4, 3.0.0, 2.25.0
    • rest
    • None
    • Unknown

    Description

      If rest dsl routes have their own customer ids, the id would be ignored, hence generate invalid swagger operation Id
      the testcase here can expose this problem

      --- a/core/camel-core/src/test/java/org/apache/camel/impl/RouteIdRestDefinitionTest.java
      +++ b/core/camel-core/src/test/java/org/apache/camel/impl/RouteIdRestDefinitionTest.java
      @@ -39,7 +39,8 @@ public class RouteIdRestDefinitionTest extends ContextTestSupport {
                   public void configure() throws Exception {
                       from("direct:start1?timeout=30000").to("mock:result");
                       from("direct:start2").to("mock:result");
      -                rest("/say/hello").get("/bar").id("getSayHelloBar").to("mock:result");
      +                rest("/say/hello").get("/bar").id("getSayHelloBar").to("mock:result")
      +                .get("/bar/{user}").id("getSayHelloBarWithUser").to("mock:result");
                   }
               };
           }
      @@ -47,6 +48,7 @@ public class RouteIdRestDefinitionTest extends ContextTestSupport {
           @Test
           public void testSayHelloBar() {
               assertEquals("getSayHelloBar", context.getRouteDefinitions().get(2).getId());
      +        assertEquals("getSayHelloBarWithUser", context.getRouteDefinitions().get(3).getId());
           }
           
       }
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ffang Freeman Yue Fang
            ffang Freeman Yue Fang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment