You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/10/25 07:34:32 UTC

[camel] branch main updated: CAMEL-17675: Update rest-dsl docs

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new e1132664e2a CAMEL-17675: Update rest-dsl docs
e1132664e2a is described below

commit e1132664e2a580bbad601eb67f5709e88bcbc0bc
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Oct 25 09:34:21 2022 +0200

    CAMEL-17675: Update rest-dsl docs
---
 docs/user-manual/modules/ROOT/pages/rest-dsl.adoc | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/rest-dsl.adoc b/docs/user-manual/modules/ROOT/pages/rest-dsl.adoc
index 14a55dd23aa..c6db7a5d729 100644
--- a/docs/user-manual/modules/ROOT/pages/rest-dsl.adoc
+++ b/docs/user-manual/modules/ROOT/pages/rest-dsl.adoc
@@ -624,12 +624,14 @@ restConfiguration().component("netty-http").host("localhost").port(portNum).bind
 // use the rest DSL to define the rest services
 rest("/users/")
     .post("lives").type(UserPojo.class).outType(CountryPojo.class)
-        .route()
-            .choice()
-                .when().simple("${body.id} < 100")
-                    .bean(new UserErrorService(), "idToLowError")
-                .otherwise()
-                    .bean(new UserService(), "livesWhere");
+    .to("direct:users-lives");
+
+from("direct:users-lives")
+    .choice()
+        .when().simple("${body.id} < 100")
+            .bean(new UserErrorService(), "idToLowError")
+        .otherwise()
+            .bean(new UserService(), "livesWhere");
 ----
 
 In this example if the input id is a number that is below 100, we want