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 2016/08/26 16:02:41 UTC

[13/23] camel git commit: CAMEL-10164: swagger component for making rest calls with swagger schema validation and facade to actual HTTP client in use

CAMEL-10164: swagger component for making rest calls with swagger schema validation and facade to actual HTTP client in use


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d167bf2a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d167bf2a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d167bf2a

Branch: refs/heads/master
Commit: d167bf2a4600c0a48d02cb90cdaffe1ee2a650e8
Parents: f894c7d
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Aug 25 10:37:35 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Aug 26 16:53:31 2016 +0200

----------------------------------------------------------------------
 camel-core/src/main/docs/rest-component.adoc    |  30 ++--
 .../camel/component/rest/RestComponent.java     |  62 ++++++++
 .../camel/component/rest/RestEndpoint.java      | 115 ++++++++++++--
 .../camel/component/rest/RestProducer.java      | 149 +++++++++++++++++++
 .../apache/camel/spi/RestProducerFactory.java   |   5 +-
 .../RestComponentAutoConfiguration.java         |  51 +++++++
 .../springboot/RestComponentConfiguration.java  |  72 +++++++++
 .../main/resources/META-INF/spring.factories    |   4 +-
 .../component/jetty/JettyHttpComponent.java     |   6 +-
 .../JettyRestProducerGetQueryParamTest.java     |  57 -------
 ...ttyRestProducerGetRestConfigurationTest.java |  54 +++++++
 .../rest/producer/JettyRestProducerGetTest.java |  13 +-
 ...ttySwaggerRestProducerGetQueryParamTest.java |  60 ++++++++
 .../JettySwaggerRestProducerGetTest.java        |  62 ++++++++
 .../swagger/component/SwaggerComponent.java     |   1 +
 .../swagger/component/SwaggerEndpoint.java      |   1 +
 .../swagger/component/SwaggerProducer.java      |   5 +-
 .../component/DummyRestProducerFactory.java     |   5 +-
 .../component/SwaggerComponentGetTest.java      |   3 +
 .../camel/swagger/component/SwaggerGetTest.java |   3 +
 .../component/SwaggerGetUriParamTest.java       |   3 +
 21 files changed, 666 insertions(+), 95 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/camel-core/src/main/docs/rest-component.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/rest-component.adoc b/camel-core/src/main/docs/rest-component.adoc
index afb7d67..adf5128 100644
--- a/camel-core/src/main/docs/rest-component.adoc
+++ b/camel-core/src/main/docs/rest-component.adoc
@@ -22,7 +22,19 @@ URI Options
 ^^^^^^^^^^^
 
 // component options: START
-The REST component has no options.
+The REST component supports 3 options which are listed below.
+
+
+
+{% raw %}
+[width="100%",cols="2,1m,7",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| componentName | String | The Camel Rest component to use for the REST transport such as restlet spark-rest. If no component has been explicit configured then Camel will lookup if there is a Camel component that integrates with the Rest DSL or if a org.apache.camel.spi.RestConsumerFactory (consumer) or org.apache.camel.spi.RestProducerFactory (producer) is registered in the registry. If either one is found then that is being used.
+| apiDoc | String | The swagger api doc resource to use. The resource is loaded from classpath by default and must be in JSon format.
+| host | String | Host and port of HTTP service to use (override host in swagger schema)
+|=======================================================================
+{% endraw %}
 // component options: END
 
 // endpoint options: START
@@ -32,16 +44,16 @@ The REST component supports 14 endpoint options which are listed below:
 [width="100%",cols="2,1,1m,1m,5",options="header"]
 |=======================================================================
 | Name | Group | Default | Java Type | Description
-| method | consumer |  | String | *Required* HTTP method to use.
-| path | consumer |  | String | *Required* The base path
-| uriTemplate | consumer |  | String | The uri template
+| method | common |  | String | *Required* HTTP method to use.
+| path | common |  | String | *Required* The base path
+| uriTemplate | common |  | String | The uri template
+| componentName | common |  | String | The Camel Rest component to use for the REST transport such as restlet spark-rest. If no component has been explicit configured then Camel will lookup if there is a Camel component that integrates with the Rest DSL or if a org.apache.camel.spi.RestConsumerFactory is registered in the registry. If either one is found then that is being used.
+| consumes | common |  | String | Media type such as: 'text/xml' or 'application/json' this REST service accepts. By default we accept all kinds of types.
+| inType | common |  | String | To declare the incoming POJO binding type as a FQN class name
+| outType | common |  | String | To declare the outgoing POJO binding type as a FQN class name
+| produces | common |  | String | Media type such as: 'text/xml' or 'application/json' this REST service returns.
 | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
-| componentName | consumer |  | String | The Camel Rest component to use for the REST transport such as restlet spark-rest. If no component has been explicit configured then Camel will lookup if there is a Camel component that integrates with the Rest DSL or if a org.apache.camel.spi.RestConsumerFactory is registered in the registry. If either one is found then that is being used.
-| consumes | consumer |  | String | Media type such as: 'text/xml' or 'application/json' this REST service accepts. By default we accept all kinds of types.
 | description | consumer |  | String | Human description to document this REST service
-| inType | consumer |  | String | To declare the incoming POJO binding type as a FQN class name
-| outType | consumer |  | String | To declare the outgoing POJO binding type as a FQN class name
-| produces | consumer |  | String | Media type such as: 'text/xml' or 'application/json' this REST service returns.
 | routeId | consumer |  | String | Name of the route this REST services creates
 | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
 | exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange.

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/camel-core/src/main/java/org/apache/camel/component/rest/RestComponent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestComponent.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestComponent.java
index 857e750..ff5093b 100644
--- a/camel-core/src/main/java/org/apache/camel/component/rest/RestComponent.java
+++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestComponent.java
@@ -22,12 +22,17 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.impl.UriEndpointComponent;
 import org.apache.camel.util.FileUtil;
 import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.URISupport;
 
 /**
  * REST-DSL component.
  */
 public class RestComponent extends UriEndpointComponent {
 
+    private String componentName;
+    private String apiDoc;
+    private String host;
+
     public RestComponent() {
         super(RestEndpoint.class);
     }
@@ -35,8 +40,27 @@ public class RestComponent extends UriEndpointComponent {
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         RestEndpoint answer = new RestEndpoint(uri, this);
+        answer.setComponentName(componentName);
+        answer.setApiDoc(apiDoc);
+
+        // if no explicit host was given, then fallback and use default configured host
+        String h = resolveAndRemoveReferenceParameter(parameters, "host", String.class, host);
+        if (h == null && getCamelContext().getRestConfiguration() != null) {
+            h = getCamelContext().getRestConfiguration().getHost();
+        }
+        // host must start with http:// or https://
+        if (h != null && !(h.startsWith("http://") || h.startsWith("https://"))) {
+            h = "http://" + h;
+        }
+        answer.setHost(h);
+
         setProperties(answer, parameters);
         answer.setParameters(parameters);
+        // the rest is URI parameters on path
+        String query = URISupport.createQueryString(parameters);
+        if (ObjectHelper.isNotEmpty(query)) {
+            answer.setQueryParameters(query);
+        }
 
         if (!remaining.contains(":")) {
             throw new IllegalArgumentException("Invalid syntax. Must be rest:method:path[:uriTemplate] where uriTemplate is optional");
@@ -71,4 +95,42 @@ public class RestComponent extends UriEndpointComponent {
         return answer;
     }
 
+    public String getComponentName() {
+        return componentName;
+    }
+
+    /**
+     * The Camel Rest component to use for the REST transport, such as restlet, spark-rest.
+     * If no component has been explicit configured, then Camel will lookup if there is a Camel component
+     * that integrates with the Rest DSL, or if a org.apache.camel.spi.RestConsumerFactory (consumer)
+     * or org.apache.camel.spi.RestProducerFactory (producer) is registered in the registry.
+     * If either one is found, then that is being used.
+     */
+    public void setComponentName(String componentName) {
+        this.componentName = componentName;
+    }
+
+    public String getApiDoc() {
+        return apiDoc;
+    }
+
+    /**
+     * The swagger api doc resource to use.
+     * The resource is loaded from classpath by default and must be in JSon format.
+     */
+    public void setApiDoc(String apiDoc) {
+        this.apiDoc = apiDoc;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    /**
+     * Host and port of HTTP service to use (override host in swagger schema)
+     */
+    public void setHost(String host) {
+        this.host = host;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
index e38ffec..f023355 100644
--- a/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
@@ -29,6 +29,7 @@ import org.apache.camel.impl.DefaultEndpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.RestConfiguration;
 import org.apache.camel.spi.RestConsumerFactory;
+import org.apache.camel.spi.RestProducerFactory;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
@@ -41,26 +42,32 @@ import org.apache.camel.util.ObjectHelper;
 @UriEndpoint(scheme = "rest", title = "REST", syntax = "rest:method:path:uriTemplate", consumerOnly = true, label = "core,rest", lenientProperties = true)
 public class RestEndpoint extends DefaultEndpoint {
 
-    @UriPath(enums = "get,post,put,delete,patch,head,trace,connect,options") @Metadata(required = "true")
+    @UriPath(label = "common", enums = "get,post,put,delete,patch,head,trace,connect,options") @Metadata(required = "true")
     private String method;
-    @UriPath @Metadata(required = "true")
+    @UriPath(label = "common") @Metadata(required = "true")
     private String path;
-    @UriPath
+    @UriPath(label = "common")
     private String uriTemplate;
-    @UriParam
+    @UriParam(label = "common")
     private String consumes;
-    @UriParam
+    @UriParam(label = "common")
     private String produces;
-    @UriParam
+    @UriParam(label = "common")
     private String componentName;
-    @UriParam
+    @UriParam(label = "common")
     private String inType;
-    @UriParam
+    @UriParam(label = "common")
     private String outType;
-    @UriParam
+    @UriParam(label = "consumer")
     private String routeId;
-    @UriParam
+    @UriParam(label = "consumer")
     private String description;
+    @UriParam(label = "producer")
+    private String apiDoc;
+    @UriParam(label = "producer")
+    private String host;
+    @UriParam(label = "producer", multiValue = true)
+    private String queryParameters;
 
     private Map<String, Object> parameters;
 
@@ -199,9 +206,95 @@ public class RestEndpoint extends DefaultEndpoint {
         this.parameters = parameters;
     }
 
+    public String getApiDoc() {
+        return apiDoc;
+    }
+
+    /**
+     * The swagger api doc resource to use.
+     * The resource is loaded from classpath by default and must be in JSon format.
+     */
+    public void setApiDoc(String apiDoc) {
+        this.apiDoc = apiDoc;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    /**
+     * Host and port of HTTP service to use (override host in swagger schema)
+     */
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public String getQueryParameters() {
+        return queryParameters;
+    }
+
+    /**
+     * Query parameters for the HTTP service to call
+     */
+    public void setQueryParameters(String queryParameters) {
+        this.queryParameters = queryParameters;
+    }
+
     @Override
     public Producer createProducer() throws Exception {
-        throw new UnsupportedOperationException("Producer not supported");
+        RestProducerFactory factory = null;
+        String cname = null;
+        if (getComponentName() != null) {
+            Object comp = getCamelContext().getRegistry().lookupByName(getComponentName());
+            if (comp != null && comp instanceof RestProducerFactory) {
+                factory = (RestProducerFactory) comp;
+            } else {
+                comp = getCamelContext().getComponent(getComponentName());
+                if (comp != null && comp instanceof RestProducerFactory) {
+                    factory = (RestProducerFactory) comp;
+                }
+            }
+
+            if (factory == null) {
+                if (comp != null) {
+                    throw new IllegalArgumentException("Component " + getComponentName() + " is not a RestProducerFactory");
+                } else {
+                    throw new NoSuchBeanException(getComponentName(), RestProducerFactory.class.getName());
+                }
+            }
+            cname = getComponentName();
+        }
+
+        // try all components
+        if (factory == null) {
+            for (String name : getCamelContext().getComponentNames()) {
+                Component comp = getCamelContext().getComponent(name);
+                if (comp != null && comp instanceof RestProducerFactory) {
+                    factory = (RestProducerFactory) comp;
+                    cname = name;
+                    break;
+                }
+            }
+        }
+
+        // lookup in registry
+        if (factory == null) {
+            Set<RestProducerFactory> factories = getCamelContext().getRegistry().findByType(RestProducerFactory.class);
+            if (factories != null && factories.size() == 1) {
+                factory = factories.iterator().next();
+            }
+        }
+
+        // TODO: if api-doc is enabled then lookup that swagger factory and use it to create the producer using the factory
+        // so we can lookup the operation and find its consumes/producers/and other details
+
+        if (factory != null) {
+            String uriTemplate = path;
+            Producer producer = factory.createProducer(getCamelContext(), host, method, path, uriTemplate, consumes, produces, parameters);
+            return new RestProducer(this, producer);
+        } else {
+            throw new IllegalStateException("Cannot find RestProducerFactory in Registry or as a Component to use");
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/camel-core/src/main/java/org/apache/camel/component/rest/RestProducer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestProducer.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestProducer.java
new file mode 100644
index 0000000..8efacd3
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestProducer.java
@@ -0,0 +1,149 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.rest;
+
+import java.util.Map;
+
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.AsyncProcessor;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Producer;
+import org.apache.camel.impl.DefaultAsyncProducer;
+import org.apache.camel.tools.apt.helper.CollectionStringBuffer;
+import org.apache.camel.util.AsyncProcessorConverterHelper;
+import org.apache.camel.util.FileUtil;
+import org.apache.camel.util.ServiceHelper;
+import org.apache.camel.util.URISupport;
+
+public class RestProducer extends DefaultAsyncProducer {
+
+    private AsyncProcessor producer;
+
+    public RestProducer(Endpoint endpoint, Producer producer) {
+        super(endpoint);
+        this.producer = AsyncProcessorConverterHelper.convert(producer);
+    }
+
+    @Override
+    public boolean process(Exchange exchange, AsyncCallback callback) {
+        // TODO: bind to consumes context-type
+        // TODO: if binding is turned on/off/auto etc
+        try {
+            prepareExchange(exchange);
+            return producer.process(exchange, callback);
+        } catch (Throwable e) {
+            exchange.setException(e);
+            callback.done(true);
+            return true;
+        }
+    }
+
+    @Override
+    public RestEndpoint getEndpoint() {
+        return (RestEndpoint) super.getEndpoint();
+    }
+
+    protected void prepareExchange(Exchange exchange) throws Exception {
+        boolean hasPath = false;
+
+        // uri template with path parameters resolved
+        // uri template may be optional and the user have entered the uri template in the path instead
+        String resolvedUriTemplate = getEndpoint().getUriTemplate() != null ? getEndpoint().getUriTemplate() : getEndpoint().getPath();
+
+        if (resolvedUriTemplate.contains("{")) {
+            // resolve template and replace {key} with the values form the exchange
+            // each {} is a parameter (url templating)
+            String[] arr = resolvedUriTemplate.split("\\/");
+            CollectionStringBuffer csb = new CollectionStringBuffer("/");
+            for (String a : arr) {
+                if (a.startsWith("{") && a.endsWith("}")) {
+                    String key = a.substring(1, a.length() - 1);
+                    String value = exchange.getIn().getHeader(key, String.class);
+                    if (value != null) {
+                        hasPath = true;
+                        // we need to remove the header as they are sent as path instead
+                        // TODO: we could use a header filter strategy to skip these headers
+                        exchange.getIn().removeHeader(key);
+                        csb.append(key + "=" + value);
+                    } else {
+                        csb.append(a);
+                    }
+                } else {
+                    csb.append(a);
+                }
+            }
+            resolvedUriTemplate = csb.toString();
+        }
+
+        // resolve uri parameters
+        String query = getEndpoint().getQueryParameters();
+        if (query != null) {
+            Map<String, Object> params = URISupport.parseQuery(query);
+            for (Map.Entry<String, Object> entry : params.entrySet()) {
+                Object v = entry.getValue();
+                if (v != null) {
+                    String a = v.toString();
+                    if (a.startsWith("{") && a.endsWith("}")) {
+                        String key = a.substring(1, a.length() - 1);
+                        String value = exchange.getIn().getHeader(key, String.class);
+                        if (value != null) {
+                            params.put(entry.getKey(), value);
+                        } else {
+                            params.put(entry.getKey(), entry.getValue());
+                        }
+                    } else {
+                        params.put(entry.getKey(), entry.getValue());
+                    }
+                }
+            }
+            query = URISupport.createQueryString(params);
+        }
+
+        if (query != null) {
+            exchange.getIn().setHeader(Exchange.HTTP_QUERY, query);
+        }
+
+        if (hasPath) {
+            String host = getEndpoint().getHost();
+            String basePath = getEndpoint().getUriTemplate() != null ? getEndpoint().getPath() :  null;
+            basePath = FileUtil.stripLeadingSeparator(basePath);
+            resolvedUriTemplate = FileUtil.stripLeadingSeparator(resolvedUriTemplate);
+            // if so us a header for the dynamic uri template so we reuse same endpoint but the header overrides the actual url to use
+            String overrideUri;
+            if (basePath != null) {
+                overrideUri = String.format("%s/%s/%s", host, basePath, resolvedUriTemplate);
+            } else {
+                overrideUri = String.format("%s/%s", host, resolvedUriTemplate);
+            }
+            exchange.getIn().setHeader(Exchange.HTTP_URI, overrideUri);
+        }
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+        ServiceHelper.startService(producer);
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        super.doStop();
+        ServiceHelper.stopService(producer);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/camel-core/src/main/java/org/apache/camel/spi/RestProducerFactory.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/RestProducerFactory.java b/camel-core/src/main/java/org/apache/camel/spi/RestProducerFactory.java
index ae7f6f5..f3ab1f7 100644
--- a/camel-core/src/main/java/org/apache/camel/spi/RestProducerFactory.java
+++ b/camel-core/src/main/java/org/apache/camel/spi/RestProducerFactory.java
@@ -32,8 +32,7 @@ public interface RestProducerFactory {
      * Creates a new REST producer.
      *
      * @param camelContext        the camel context
-     * @param scheme              scheme to use such as http or https
-     * @param host                host (incl port) of the REST service
+     * @param host                host in the syntax scheme:hostname:port, such as http:myserver:8080
      * @param verb                HTTP verb such as GET, POST
      * @param basePath            base path
      * @param uriTemplate         uri template
@@ -43,6 +42,6 @@ public interface RestProducerFactory {
      * @return a newly created REST producer
      * @throws Exception can be thrown
      */
-    Producer createProducer(CamelContext camelContext, String scheme, String host,
+    Producer createProducer(CamelContext camelContext, String host,
                             String verb, String basePath, String uriTemplate, String consumes, String produces, Map<String, Object> parameters) throws Exception;
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestComponentAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestComponentAutoConfiguration.java
new file mode 100644
index 0000000..4efa583
--- /dev/null
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestComponentAutoConfiguration.java
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.rest.springboot;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.rest.RestComponent;
+import org.apache.camel.util.IntrospectionSupport;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@EnableConfigurationProperties(RestComponentConfiguration.class)
+public class RestComponentAutoConfiguration {
+
+    @Bean(name = "rest-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(RestComponent.class)
+    public RestComponent configureRestComponent(CamelContext camelContext,
+            RestComponentConfiguration configuration) throws Exception {
+        RestComponent component = new RestComponent();
+        component.setCamelContext(camelContext);
+        Map<String, Object> parameters = new HashMap<>();
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
+        IntrospectionSupport.setProperties(camelContext,
+                camelContext.getTypeConverter(), component, parameters);
+        return component;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestComponentConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestComponentConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestComponentConfiguration.java
new file mode 100644
index 0000000..caf73cf
--- /dev/null
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestComponentConfiguration.java
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.rest.springboot;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * The rest component is used for hosting REST services which has been defined
+ * using the rest-dsl in Camel.
+ * 
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@ConfigurationProperties(prefix = "camel.component.rest")
+public class RestComponentConfiguration {
+
+    /**
+     * The Camel Rest component to use for the REST transport such as restlet
+     * spark-rest. If no component has been explicit configured then Camel will
+     * lookup if there is a Camel component that integrates with the Rest DSL or
+     * if a org.apache.camel.spi.RestConsumerFactory (consumer) or
+     * org.apache.camel.spi.RestProducerFactory (producer) is registered in the
+     * registry. If either one is found then that is being used.
+     */
+    private String componentName;
+    /**
+     * The swagger api doc resource to use. The resource is loaded from
+     * classpath by default and must be in JSon format.
+     */
+    private String apiDoc;
+    /**
+     * Host and port of HTTP service to use (override host in swagger schema)
+     */
+    private String host;
+
+    public String getComponentName() {
+        return componentName;
+    }
+
+    public void setComponentName(String componentName) {
+        this.componentName = componentName;
+    }
+
+    public String getApiDoc() {
+        return apiDoc;
+    }
+
+    public void setApiDoc(String apiDoc) {
+        this.apiDoc = apiDoc;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories b/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories
index 0ec9c44..563f83b 100644
--- a/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories
+++ b/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories
@@ -39,7 +39,9 @@ org.apache.camel.language.xpath.springboot.XPathLanguageAutoConfiguration,\
 org.apache.camel.language.simple.springboot.FileLanguageAutoConfiguration,\
 org.apache.camel.language.property.springboot.ExchangePropertyLanguageAutoConfiguration,\
 org.apache.camel.language.tokenizer.springboot.TokenizeLanguageAutoConfiguration,\
-org.apache.camel.language.tokenizer.springboot.XMLTokenizeLanguageAutoConfiguration
+org.apache.camel.language.tokenizer.springboot.XMLTokenizeLanguageAutoConfiguration,\
+org.apache.camel.component.rest.springboot.RestComponentAutoConfiguration
+
 
 
 

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
index 3b3e91d..adc28f1 100644
--- a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
+++ b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
@@ -1151,7 +1151,7 @@ public abstract class JettyHttpComponent extends HttpCommonComponent implements
     }
 
     @Override
-    public Producer createProducer(CamelContext camelContext, String scheme, String host,
+    public Producer createProducer(CamelContext camelContext, String host,
                                    String verb, String basePath, String uriTemplate,
                                    String consumes, String produces, Map<String, Object> parameters) throws Exception {
 
@@ -1160,8 +1160,8 @@ public abstract class JettyHttpComponent extends HttpCommonComponent implements
         uriTemplate = FileUtil.stripLeadingSeparator(uriTemplate);
 
         // get the endpoint
-        String url = "jetty:%s://%s/%s/%s";
-        url = String.format(url, scheme, host, basePath, uriTemplate);
+        String url = "jetty:%s/%s/%s";
+        url = String.format(url, host, basePath, uriTemplate);
 
         JettyHttpEndpoint endpoint = camelContext.getEndpoint(url, JettyHttpEndpoint.class);
         if (parameters != null && !parameters.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetQueryParamTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetQueryParamTest.java b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetQueryParamTest.java
deleted file mode 100644
index cfdc0f0..0000000
--- a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetQueryParamTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.jetty.rest.producer;
-
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.jetty.BaseJettyTest;
-import org.apache.camel.swagger.component.SwaggerComponent;
-import org.junit.Test;
-
-public class JettyRestProducerGetQueryParamTest extends BaseJettyTest {
-
-    @Test
-    public void testSwaggerGet() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Bye Donald Duck");
-
-        template.sendBodyAndHeader("direct:start", null, "name", "Donald Duck");
-
-        assertMockEndpointsSatisfied();
-    }
-
-    @Override
-    protected RoutesBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                SwaggerComponent sc = new SwaggerComponent();
-                sc.setComponentName("jetty");
-                context.addComponent("swagger", sc);
-
-                String host = "localhost:" + getPort();
-
-                from("direct:start")
-                        .toF("swagger:get:bye?host=%s&apiDoc=%s", host, "hello-api.json")
-                        .to("mock:result");
-
-                from("jetty:http://localhost:{{port}}/api/bye/?matchOnUriPrefix=true")
-                    .transform().simple("Bye ${header.name}");
-            }
-        };
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetRestConfigurationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetRestConfigurationTest.java b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetRestConfigurationTest.java
new file mode 100644
index 0000000..b701c81
--- /dev/null
+++ b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetRestConfigurationTest.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jetty.rest.producer;
+
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jetty.BaseJettyTest;
+import org.junit.Test;
+
+public class JettyRestProducerGetRestConfigurationTest extends BaseJettyTest {
+
+    @Test
+    public void testRestGet() throws Exception {
+        getMockEndpoint("mock:result").expectedBodiesReceived("Hello Donald Duck");
+
+        template.sendBodyAndHeader("direct:start", null, "name", "Donald Duck");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                String host = "localhost:" + getPort();
+
+                restConfiguration().host(host).component("jetty");
+
+                from("direct:start")
+                        .to("rest:get:api:hello/hi/{name}")
+                        .to("mock:result");
+
+                from("jetty:http://localhost:{{port}}/api/hello/hi/?matchOnUriPrefix=true")
+                    .transform().constant("Hello Donald Duck");
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetTest.java b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetTest.java
index fda373c..c20f62c 100644
--- a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetTest.java
+++ b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettyRestProducerGetTest.java
@@ -19,13 +19,13 @@ package org.apache.camel.component.jetty.rest.producer;
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.jetty.BaseJettyTest;
-import org.apache.camel.swagger.component.SwaggerComponent;
+import org.apache.camel.component.rest.RestComponent;
 import org.junit.Test;
 
 public class JettyRestProducerGetTest extends BaseJettyTest {
 
     @Test
-    public void testSwaggerGet() throws Exception {
+    public void testRestGet() throws Exception {
         getMockEndpoint("mock:result").expectedBodiesReceived("Hello Donald Duck");
 
         template.sendBodyAndHeader("direct:start", null, "name", "Donald Duck");
@@ -38,16 +38,15 @@ public class JettyRestProducerGetTest extends BaseJettyTest {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                String host = "localhost:" + getPort();
+                String host = "http://localhost:" + getPort();
 
-                SwaggerComponent sc = new SwaggerComponent();
+                RestComponent sc = new RestComponent();
                 sc.setComponentName("jetty");
                 sc.setHost(host);
-                sc.setApiDoc("hello-api.json");
-                context.addComponent("swagger", sc);
+                context.addComponent("rest", sc);
 
                 from("direct:start")
-                        .to("swagger:get:hello/hi/{name}")
+                        .to("rest:get:api:hello/hi/{name}")
                         .to("mock:result");
 
                 from("jetty:http://localhost:{{port}}/api/hello/hi/?matchOnUriPrefix=true")

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettySwaggerRestProducerGetQueryParamTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettySwaggerRestProducerGetQueryParamTest.java b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettySwaggerRestProducerGetQueryParamTest.java
new file mode 100644
index 0000000..7ee98f6
--- /dev/null
+++ b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettySwaggerRestProducerGetQueryParamTest.java
@@ -0,0 +1,60 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jetty.rest.producer;
+
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jetty.BaseJettyTest;
+import org.apache.camel.swagger.component.SwaggerComponent;
+import org.junit.Ignore;
+import org.junit.Test;
+
+@Ignore
+@Deprecated
+public class JettySwaggerRestProducerGetQueryParamTest extends BaseJettyTest {
+
+    @Test
+    public void testSwaggerGet() throws Exception {
+        getMockEndpoint("mock:result").expectedBodiesReceived("Bye Donald Duck");
+
+        template.sendBodyAndHeader("direct:start", null, "name", "Donald Duck");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                SwaggerComponent sc = new SwaggerComponent();
+                sc.setComponentName("jetty");
+                context.addComponent("swagger", sc);
+
+                String host = "localhost:" + getPort();
+
+                from("direct:start")
+                        .toF("swagger:get:bye?host=%s&apiDoc=%s", host, "hello-api.json")
+                        .to("mock:result");
+
+                from("jetty:http://localhost:{{port}}/api/bye/?matchOnUriPrefix=true")
+                    .transform().simple("Bye ${header.name}");
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettySwaggerRestProducerGetTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettySwaggerRestProducerGetTest.java b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettySwaggerRestProducerGetTest.java
new file mode 100644
index 0000000..3438390
--- /dev/null
+++ b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/rest/producer/JettySwaggerRestProducerGetTest.java
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jetty.rest.producer;
+
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jetty.BaseJettyTest;
+import org.apache.camel.swagger.component.SwaggerComponent;
+import org.junit.Ignore;
+import org.junit.Test;
+
+@Ignore
+@Deprecated
+public class JettySwaggerRestProducerGetTest extends BaseJettyTest {
+
+    @Test
+    public void testSwaggerGet() throws Exception {
+        getMockEndpoint("mock:result").expectedBodiesReceived("Hello Donald Duck");
+
+        template.sendBodyAndHeader("direct:start", null, "name", "Donald Duck");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                String host = "localhost:" + getPort();
+
+                SwaggerComponent sc = new SwaggerComponent();
+                sc.setComponentName("jetty");
+                sc.setHost(host);
+                sc.setApiDoc("hello-api.json");
+                context.addComponent("swagger", sc);
+
+                from("direct:start")
+                        .to("swagger:get:hello/hi/{name}")
+                        .to("mock:result");
+
+                from("jetty:http://localhost:{{port}}/api/hello/hi/?matchOnUriPrefix=true")
+                    .transform().constant("Hello Donald Duck");
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerComponent.java b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerComponent.java
index d9c71fa..6634c13 100644
--- a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerComponent.java
+++ b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerComponent.java
@@ -22,6 +22,7 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.impl.UriEndpointComponent;
 import org.apache.camel.util.URISupport;
 
+@Deprecated
 public class SwaggerComponent extends UriEndpointComponent {
 
     private String componentName = "http";

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerEndpoint.java b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerEndpoint.java
index 0c7ccb9..375b22d 100644
--- a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerEndpoint.java
+++ b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerEndpoint.java
@@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory;
 
 import static org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream;
 
+@Deprecated
 @UriEndpoint(scheme = "swagger", title = "Swagger", syntax = "swagger:verb:path",
         producerOnly = true, label = "rest", lenientProperties = true)
 public class SwaggerEndpoint extends DefaultEndpoint {

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerProducer.java b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerProducer.java
index 7e1fda2..0422dd9 100644
--- a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerProducer.java
+++ b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/component/SwaggerProducer.java
@@ -44,6 +44,7 @@ import org.apache.camel.util.URISupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@Deprecated
 public class SwaggerProducer extends DefaultAsyncProducer {
 
     private static final Logger LOG = LoggerFactory.getLogger(SwaggerProducer.class);
@@ -267,13 +268,11 @@ public class SwaggerProducer extends DefaultAsyncProducer {
                 }
             }
 
-            // TODO: allow to chose scheme if there is multiple
-            String scheme = swagger.getSchemes() != null && swagger.getSchemes().size() == 1 ? swagger.getSchemes().get(0).toValue() : "http";
             String host = getEndpoint().getHost() != null ? getEndpoint().getHost() : swagger.getHost();
             String basePath = swagger.getBasePath();
             String uriTemplate = path;
 
-            return factory.createProducer(getEndpoint().getCamelContext(), scheme, host, verb, basePath, uriTemplate,
+            return factory.createProducer(getEndpoint().getCamelContext(), host, verb, basePath, uriTemplate,
                     (consumes.isEmpty() ? "" : consumes.toString()), (produces.isEmpty() ? "" : produces.toString()), null);
 
         } else {

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/DummyRestProducerFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/DummyRestProducerFactory.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/DummyRestProducerFactory.java
index 499dd7e..4c27856 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/DummyRestProducerFactory.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/DummyRestProducerFactory.java
@@ -25,11 +25,14 @@ import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultProducer;
 import org.apache.camel.spi.RestProducerFactory;
 import org.apache.camel.util.ObjectHelper;
+import org.junit.Ignore;
 
+@Deprecated
+@Ignore
 public class DummyRestProducerFactory implements RestProducerFactory {
 
     @Override
-    public Producer createProducer(CamelContext camelContext, String scheme, String host,
+    public Producer createProducer(CamelContext camelContext, String host,
                             String verb, String basePath, final String uriTemplate,
                             String consumes, String produces, Map<String, Object> parameters) throws Exception {
 

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerComponentGetTest.java
----------------------------------------------------------------------
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerComponentGetTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerComponentGetTest.java
index 92e62de..6608be5 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerComponentGetTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerComponentGetTest.java
@@ -20,8 +20,11 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Ignore;
 import org.junit.Test;
 
+@Deprecated
+@Ignore
 public class SwaggerComponentGetTest extends CamelTestSupport {
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetTest.java
----------------------------------------------------------------------
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetTest.java
index 1575d02..74c404a 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetTest.java
@@ -20,8 +20,11 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Ignore;
 import org.junit.Test;
 
+@Deprecated
+@Ignore
 public class SwaggerGetTest extends CamelTestSupport {
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/d167bf2a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetUriParamTest.java
----------------------------------------------------------------------
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetUriParamTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetUriParamTest.java
index 0a76f01..780790c 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetUriParamTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/component/SwaggerGetUriParamTest.java
@@ -20,8 +20,11 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Ignore;
 import org.junit.Test;
 
+@Deprecated
+@Ignore
 public class SwaggerGetUriParamTest extends CamelTestSupport {
 
     @Override