Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0AA36200CDD for ; Mon, 7 Aug 2017 10:22:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 09060164D16; Mon, 7 Aug 2017 08:22:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4ED0C164D14 for ; Mon, 7 Aug 2017 10:22:17 +0200 (CEST) Received: (qmail 63038 invoked by uid 500); 7 Aug 2017 08:22:16 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 63029 invoked by uid 99); 7 Aug 2017 08:22:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2017 08:22:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A044FF329E; Mon, 7 Aug 2017 08:22:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Mon, 07 Aug 2017 08:22:16 -0000 Message-Id: <1c903e98bc2f4d7aa9df756587cc8908@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] camel git commit: CAMEL-11636: rest-dsl should also use property placeholders on the verb and its params. archived-at: Mon, 07 Aug 2017 08:22:18 -0000 CAMEL-11636: rest-dsl should also use property placeholders on the verb and its params. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/507916f5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/507916f5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/507916f5 Branch: refs/heads/camel-2.19.x Commit: 507916f525ecbd999bc2b45836abdc0acf553b8f Parents: 0083911 Author: Claus Ibsen Authored: Mon Aug 7 09:39:20 2017 +0200 Committer: Claus Ibsen Committed: Mon Aug 7 10:22:00 2017 +0200 ---------------------------------------------------------------------- .../apache/camel/model/rest/RestDefinition.java | 11 +++++++++++ .../src/main/resources/camel-config-xml.xml | 6 +++++- .../src/main/resources/rest.properties | 17 +++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/507916f5/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java index b668f48..fa024ae 100644 --- a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java +++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java @@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlRootElement; import org.apache.camel.CamelContext; import org.apache.camel.model.OptionalIdentifiedDefinition; import org.apache.camel.model.ProcessorDefinition; +import org.apache.camel.model.ProcessorDefinitionHelper; import org.apache.camel.model.RouteDefinition; import org.apache.camel.model.ToDefinition; import org.apache.camel.model.ToDynamicDefinition; @@ -723,6 +724,16 @@ public class RestDefinition extends OptionalIdentifiedDefinition route.getOutputs().add(def); } + // ensure property placeholders is resolved on the verb + try { + ProcessorDefinitionHelper.resolvePropertyPlaceholders(camelContext, verb); + for (RestOperationParamDefinition param : verb.getParams()) { + ProcessorDefinitionHelper.resolvePropertyPlaceholders(camelContext, param); + } + } catch (Exception e) { + throw ObjectHelper.wrapRuntimeCamelException(e); + } + // add the binding RestBindingDefinition binding = new RestBindingDefinition(); binding.setComponent(component); http://git-wip-us.apache.org/repos/asf/camel/blob/507916f5/examples/camel-example-swagger-xml/src/main/resources/camel-config-xml.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-swagger-xml/src/main/resources/camel-config-xml.xml b/examples/camel-example-swagger-xml/src/main/resources/camel-config-xml.xml index 45d4c0f..f037180 100755 --- a/examples/camel-example-swagger-xml/src/main/resources/camel-config-xml.xml +++ b/examples/camel-example-swagger-xml/src/main/resources/camel-config-xml.xml @@ -28,6 +28,9 @@ + + +