You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/03/30 16:37:50 UTC
[camel] 15/16: CAMEL-17792: Add doc about the message headers of camel-json-patch
This is an automated email from the ASF dual-hosted git repository.
nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0125c6ea30d70a6fb85b07a17163d1bd276d8bc6
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Wed Mar 30 18:12:12 2022 +0200
CAMEL-17792: Add doc about the message headers of camel-json-patch
---
.../resources/org/apache/camel/component/jsonpatch/json-patch.json | 3 +++
components/camel-json-patch/src/main/docs/json-patch-component.adoc | 3 +++
.../java/org/apache/camel/component/jsonpatch/JsonPatchConstants.java | 4 ++++
.../java/org/apache/camel/component/jsonpatch/JsonPatchEndpoint.java | 2 +-
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/components/camel-json-patch/src/generated/resources/org/apache/camel/component/jsonpatch/json-patch.json b/components/camel-json-patch/src/generated/resources/org/apache/camel/component/jsonpatch/json-patch.json
index fb458d2..f747be0 100644
--- a/components/camel-json-patch/src/generated/resources/org/apache/camel/component/jsonpatch/json-patch.json
+++ b/components/camel-json-patch/src/generated/resources/org/apache/camel/component/jsonpatch/json-patch.json
@@ -25,6 +25,9 @@
"lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 star [...]
"autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
},
+ "headers": {
+ "CamelJsonPatchResourceUri": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The resource URI" }
+ },
"properties": {
"resourceUri": { "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Path to the resource. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will lookup the resource in the registry. bean will [...]
"allowContextMapAll": { "kind": "parameter", "displayName": "Allow Context Map All", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether the context map should allow access to all details. By default only the message body and headers can be accessed. This option can be enabled for full access to the current Exchange and CamelContext. [...]
diff --git a/components/camel-json-patch/src/main/docs/json-patch-component.adoc b/components/camel-json-patch/src/main/docs/json-patch-component.adoc
index 784561c..d2607ce 100644
--- a/components/camel-json-patch/src/main/docs/json-patch-component.adoc
+++ b/components/camel-json-patch/src/main/docs/json-patch-component.adoc
@@ -54,5 +54,8 @@ include::partial$component-endpoint-options.adoc[]
// endpoint options: START
// endpoint options: END
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchConstants.java b/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchConstants.java
index 45d9689..7d3894d 100644
--- a/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchConstants.java
+++ b/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchConstants.java
@@ -16,7 +16,11 @@
*/
package org.apache.camel.component.jsonpatch;
+import org.apache.camel.spi.Metadata;
+
public final class JsonPatchConstants {
+
+ @Metadata(label = "producer", description = "The resource URI", javaType = "String")
public static final String JSON_PATCH_RESOURCE_URI = "CamelJsonPatchResourceUri";
private JsonPatchConstants() {
diff --git a/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchEndpoint.java b/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchEndpoint.java
index fb584fd..9dfaba2 100644
--- a/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchEndpoint.java
+++ b/components/camel-json-patch/src/main/java/org/apache/camel/component/jsonpatch/JsonPatchEndpoint.java
@@ -29,7 +29,7 @@ import org.apache.camel.spi.UriEndpoint;
*/
@UriEndpoint(firstVersion = "3.12.0", scheme = "json-patch", title = "JsonPatch", syntax = "json-patch:resourceUri",
producerOnly = true,
- category = { Category.TRANSFORMATION })
+ category = { Category.TRANSFORMATION }, headersClass = JsonPatchConstants.class)
public class JsonPatchEndpoint extends ResourceEndpoint {
public JsonPatchEndpoint() {