This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 0931438 Polished and fixed typo
0931438 is described below
commit 0931438bd4e5168cc736bf1720d1594e3d103b64
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Aug 6 16:44:30 2019 +0200
Polished and fixed typo
---
.../src/main/docs/rest-swagger-component.adoc | 8 +++---
.../rest/swagger/RestSwaggerComponent.java | 33 ++++++++++------------
.../rest/swagger/RestSwaggerEndpoint.java | 6 ++--
.../RestSwaggerComponentConfiguration.java | 12 ++++----
4 files changed, 27 insertions(+), 32 deletions(-)
diff --git
a/components/camel-rest-swagger/src/main/docs/rest-swagger-component.adoc
b/components/camel-rest-swagger/src/main/docs/rest-swagger-component.adoc
index b2a8486..7636eec 100644
--- a/components/camel-rest-swagger/src/main/docs/rest-swagger-component.adoc
+++ b/components/camel-rest-swagger/src/main/docs/rest-swagger-component.adoc
@@ -93,9 +93,9 @@ The REST Swagger component supports 10 options, which are
listed below.
| *basePath* (producer) | API basePath, for example /v2. Default is unset, if
set overrides the value present in Swagger specification. | | String
| *componentName* (producer) | Name of the Camel component that will perform
the requests. The component must be present in Camel registry and it must
implement RestProducerFactory service provider interface. If not set CLASSPATH
is searched for single component that implements RestProducerFactory SPI. Can
be overridden in endpoint configuration. | | String
| *consumes* (producer) | What payload type this component capable of
consuming. Could be one type, like application/json or multiple types as
application/json, application/xml; q=0.5 according to the RFC7231. This equates
to the value of Accept HTTP header. If set overrides any value found in the
Swagger specification. Can be overridden in endpoint configuration | | String
-| *host* (producer) | Scheme hostname and port to direct the HTTP requests to
in the form of \https://hostname:port. Can be configured at the endpoint,
component or in the correspoding REST configuration in the Camel Context. If
you give this component a name (e.g. petstore) that REST configuration is
consulted first, rest-swagger next, and global configuration last. If set
overrides any value found in the Swagger specification, RestConfiguration. Can
be overridden in endpoint configurat [...]
+| *host* (producer) | Scheme hostname and port to direct the HTTP requests to
in the form of \https://hostname:port. Can be configured at the endpoint,
component or in the corresponding REST configuration in the Camel Context. If
you give this component a name (e.g. petstore) that REST configuration is
consulted first, rest-swagger next, and global configuration last. If set
overrides any value found in the Swagger specification, RestConfiguration. Can
be overridden in endpoint configura [...]
| *produces* (producer) | What payload type this component is producing. For
example application/json according to the RFC7231. This equates to the value of
Content-Type HTTP header. If set overrides any value present in the Swagger
specification. Can be overridden in endpoint configuration. | | String
-| *specificationUri* (producer) | Path to the Swagger specification file. The
scheme, host base path are taken from this specification, but these can be
overriden with properties on the component or endpoint level. If not given the
component tries to load swagger.json resource. Note that the host defined on
the component and endpoint of this Component should contain the scheme,
hostname and optionally the port in the URI syntax (i.e.
\https://api.example.com:8080). Can be overridden in e [...]
+| *specificationUri* (producer) | Path to the Swagger specification file. The
scheme, host base path are taken from this specification, but these can be
overridden with properties on the component or endpoint level. If not given the
component tries to load swagger.json resource. Note that the host defined on
the component and endpoint of this Component should contain the scheme,
hostname and optionally the port in the URI syntax (i.e.
\https://api.example.com:8080). Can be overridden in [...]
| *sslContextParameters* (security) | Customize TLS parameters used by the
component. If not set defaults to the TLS parameters set in the Camel context |
| SSLContextParameters
| *useGlobalSslContext Parameters* (security) | Enable usage of global SSL
context parameters. | false | boolean
| *resolveProperty Placeholders* (advanced) | Whether the component should
resolve property placeholders on itself when starting. Only properties which
are of String type can use property placeholders. | true | boolean
@@ -130,9 +130,9 @@ with the following path and query parameters:
|===
| Name | Description | Default | Type
| *basePath* (producer) | API basePath, for example /v2. Default is unset, if
set overrides the value present in Swagger specification and in the component
configuration. | | String
-| *componentName* (producer) | Name of the Camel component that will perform
the requests. The compnent must be present in Camel registry and it must
implement RestProducerFactory service provider interface. If not set CLASSPATH
is searched for single component that implements RestProducerFactory SPI.
Overrides component configuration. | | String
+| *componentName* (producer) | Name of the Camel component that will perform
the requests. The component must be present in Camel registry and it must
implement RestProducerFactory service provider interface. If not set CLASSPATH
is searched for single component that implements RestProducerFactory SPI.
Overrides component configuration. | | String
| *consumes* (producer) | What payload type this component capable of
consuming. Could be one type, like application/json or multiple types as
application/json, application/xml; q=0.5 according to the RFC7231. This equates
to the value of Accept HTTP header. If set overrides any value found in the
Swagger specification and. in the component configuration | | String
-| *host* (producer) | Scheme hostname and port to direct the HTTP requests to
in the form of \https://hostname:port. Can be configured at the endpoint,
component or in the correspoding REST configuration in the Camel Context. If
you give this component a name (e.g. petstore) that REST configuration is
consulted first, rest-swagger next, and global configuration last. If set
overrides any value found in the Swagger specification, RestConfiguration.
Overrides all other configuration. | | String
+| *host* (producer) | Scheme hostname and port to direct the HTTP requests to
in the form of \https://hostname:port. Can be configured at the endpoint,
component or in the corresponding REST configuration in the Camel Context. If
you give this component a name (e.g. petstore) that REST configuration is
consulted first, rest-swagger next, and global configuration last. If set
overrides any value found in the Swagger specification, RestConfiguration.
Overrides all other configuration. | | String
| *lazyStartProducer* (producer) | Whether the producer should be started lazy
(on the first message). By starting lazy you can use this to allow CamelContext
and routes to startup in situations where a producer may otherwise fail during
starting and cause the route to fail being started. By deferring this startup
to be lazy then the startup failure can be handled during routing messages via
Camel's routing error handlers. Beware that when the first message is processed
then creating and [...]
| *produces* (producer) | What payload type this component is producing. For
example application/json according to the RFC7231. This equates to the value of
Content-Type HTTP header. If set overrides any value present in the Swagger
specification. Overrides all other configuration. | | String
| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic
property binding (Camel 2.x) or the newer property binding with additional
capabilities | false | boolean
diff --git
a/components/camel-rest-swagger/src/main/java/org/apache/camel/component/rest/swagger/RestSwaggerComponent.java
b/components/camel-rest-swagger/src/main/java/org/apache/camel/component/rest/swagger/RestSwaggerComponent.java
index e9bc3e9..fab8b80 100644
---
a/components/camel-rest-swagger/src/main/java/org/apache/camel/component/rest/swagger/RestSwaggerComponent.java
+++
b/components/camel-rest-swagger/src/main/java/org/apache/camel/component/rest/swagger/RestSwaggerComponent.java
@@ -87,7 +87,7 @@ public final class RestSwaggerComponent extends
DefaultComponent implements SSLC
@Metadata(
description = "API basePath, for example \"`/v2`\". Default is unset,
if set overrides the value present in Swagger specification.",
- defaultValue = "", label = "producer", required = false)
+ defaultValue = "", label = "producer")
private String basePath = "";
@Metadata(description = "Name of the Camel component that will perform the
requests. The component must be present"
@@ -101,34 +101,34 @@ public final class RestSwaggerComponent extends
DefaultComponent implements SSLC
+ " or multiple types as `application/json, application/xml;
q=0.5` according to the RFC7231. This equates"
+ " to the value of `Accept` HTTP header. If set overrides any
value found in the Swagger specification."
+ " Can be overridden in endpoint configuration",
- label = "producer", required = false)
+ label = "producer")
private String consumes;
@Metadata(description = "Scheme hostname and port to direct the HTTP
requests to in the form of"
- + " `http[s]://hostname[:port]`. Can be configured at the endpoint,
component or in the correspoding"
+ + " `http[s]://hostname[:port]`. Can be configured at the endpoint,
component or in the corresponding"
+ " REST configuration in the Camel Context. If you give this
component a name (e.g. `petstore`) that"
+ " REST configuration is consulted first, `rest-swagger` next, and
global configuration last. If set"
+ " overrides any value found in the Swagger specification,
RestConfiguration. Can be overridden in endpoint"
- + " configuration.", label = "producer", required = false)
+ + " configuration.", label = "producer")
private String host;
@Metadata(
description = "What payload type this component is producing. For
example `application/json`"
+ " according to the RFC7231. This equates to the value of
`Content-Type` HTTP header. If set overrides"
+ " any value present in the Swagger specification. Can be
overridden in endpoint configuration.",
- label = "producer", required = false)
+ label = "producer")
private String produces;
@Metadata(description = "Path to the Swagger specification file. The
scheme, host base path are taken from this"
- + " specification, but these can be overriden with properties on the
component or endpoint level. If not"
+ + " specification, but these can be overridden with properties on the
component or endpoint level. If not"
+ " given the component tries to load `swagger.json` resource. Note
that the `host` defined on the"
+ " component and endpoint of this Component should contain the
scheme, hostname and optionally the"
+ " port in the URI syntax (i.e. `https://api.example.com:8080`). Can
be overridden in endpoint"
- + " configuration.", defaultValue = DEFAULT_SPECIFICATION_URI_STR,
label = "producer", required = false)
+ + " configuration.", defaultValue = DEFAULT_SPECIFICATION_URI_STR,
label = "producer")
private URI specificationUri;
@Metadata(description = "Customize TLS parameters used by the component.
If not set defaults to the TLS parameters"
- + " set in the Camel context ", label = "security", required = false)
+ + " set in the Camel context ", label = "security")
private SSLContextParameters sslContextParameters;
@Metadata(description = "Enable usage of global SSL context parameters.",
label = "security",
@@ -142,6 +142,13 @@ public final class RestSwaggerComponent extends
DefaultComponent implements SSLC
super(context);
}
+ @Override
+ protected Endpoint createEndpoint(final String uri, final String
remaining, final Map<String, Object> parameters) throws Exception {
+ Endpoint endpoint = new RestSwaggerEndpoint(uri, remaining, this,
parameters);
+ setProperties(endpoint, parameters);
+ return endpoint;
+ }
+
public String getBasePath() {
return basePath;
}
@@ -208,14 +215,4 @@ public final class RestSwaggerComponent extends
DefaultComponent implements SSLC
this.useGlobalSslContextParameters = useGlobalSslContextParameters;
}
- @Override
- protected Endpoint createEndpoint(final String uri, final String
remaining, final Map<String, Object> parameters)
- throws Exception {
- final Endpoint endpoint = new RestSwaggerEndpoint(uri, remaining,
this, parameters);
-
- setProperties(endpoint, parameters);
-
- return endpoint;
- }
-
}
diff --git
a/components/camel-rest-swagger/src/main/java/org/apache/camel/component/rest/swagger/RestSwaggerEndpoint.java
b/components/camel-rest-swagger/src/main/java/org/apache/camel/component/rest/swagger/RestSwaggerEndpoint.java
index ddbf410..87d3009 100644
---
a/components/camel-rest-swagger/src/main/java/org/apache/camel/component/rest/swagger/RestSwaggerEndpoint.java
+++
b/components/camel-rest-swagger/src/main/java/org/apache/camel/component/rest/swagger/RestSwaggerEndpoint.java
@@ -93,14 +93,12 @@ public final class RestSwaggerEndpoint extends
DefaultEndpoint {
description = "API basePath, for example \"`/v2`\". Default is unset,
if set overrides the value present in"
+ " Swagger specification and in the component configuration.",
defaultValue = "", label = "producer")
- @Metadata(required = false)
private String basePath;
- @UriParam(description = "Name of the Camel component that will perform the
requests. The compnent must be present"
+ @UriParam(description = "Name of the Camel component that will perform the
requests. The component must be present"
+ " in Camel registry and it must implement RestProducerFactory
service provider interface. If not set"
+ " CLASSPATH is searched for single component that implements
RestProducerFactory SPI. Overrides"
+ " component configuration.", label = "producer")
- @Metadata(required = false)
private String componentName;
@UriParam(
@@ -112,7 +110,7 @@ public final class RestSwaggerEndpoint extends
DefaultEndpoint {
private String consumes;
@UriParam(description = "Scheme hostname and port to direct the HTTP
requests to in the form of"
- + " `http[s]://hostname[:port]`. Can be configured at the endpoint,
component or in the correspoding"
+ + " `http[s]://hostname[:port]`. Can be configured at the endpoint,
component or in the corresponding"
+ " REST configuration in the Camel Context. If you give this
component a name (e.g. `petstore`) that"
+ " REST configuration is consulted first, `rest-swagger` next, and
global configuration last. If set"
+ " overrides any value found in the Swagger specification,
RestConfiguration. Overrides all other "
diff --git
a/platforms/spring-boot/components-starter/camel-rest-swagger-starter/src/main/java/org/apache/camel/component/rest/swagger/springboot/RestSwaggerComponentConfiguration.java
b/platforms/spring-boot/components-starter/camel-rest-swagger-starter/src/main/java/org/apache/camel/component/rest/swagger/springboot/RestSwaggerComponentConfiguration.java
index abc6889..561854a 100644
---
a/platforms/spring-boot/components-starter/camel-rest-swagger-starter/src/main/java/org/apache/camel/component/rest/swagger/springboot/RestSwaggerComponentConfiguration.java
+++
b/platforms/spring-boot/components-starter/camel-rest-swagger-starter/src/main/java/org/apache/camel/component/rest/swagger/springboot/RestSwaggerComponentConfiguration.java
@@ -61,7 +61,7 @@ public class RestSwaggerComponentConfiguration
/**
* Scheme hostname and port to direct the HTTP requests to in the form of
* https://hostname:port. Can be configured at the endpoint, component or
in
- * the correspoding REST configuration in the Camel Context. If you give
+ * the corresponding REST configuration in the Camel Context. If you give
* this component a name (e.g. petstore) that REST configuration is
* consulted first, rest-swagger next, and global configuration last. If
set
* overrides any value found in the Swagger specification,
@@ -77,11 +77,11 @@ public class RestSwaggerComponentConfiguration
private String produces;
/**
* Path to the Swagger specification file. The scheme, host base path are
- * taken from this specification, but these can be overriden with
properties
- * on the component or endpoint level. If not given the component tries to
- * load swagger.json resource. Note that the host defined on the component
- * and endpoint of this Component should contain the scheme, hostname and
- * optionally the port in the URI syntax (i.e.
+ * taken from this specification, but these can be overridden with
+ * properties on the component or endpoint level. If not given the
component
+ * tries to load swagger.json resource. Note that the host defined on the
+ * component and endpoint of this Component should contain the scheme,
+ * hostname and optionally the port in the URI syntax (i.e.
* https://api.example.com:8080). Can be overridden in endpoint
* configuration.
*/