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 3229b748129 CAMEL-21928: camel-jq - include variable() and body() as
new functions to access in-process data
3229b748129 is described below
commit 3229b748129e277e63e942edead3ca548cfc23cc
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Apr 5 10:45:47 2025 +0200
CAMEL-21928: camel-jq - include variable() and body() as new functions to
access in-process data
---
components/camel-jq/src/main/docs/jq-language.adoc | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/components/camel-jq/src/main/docs/jq-language.adoc
b/components/camel-jq/src/main/docs/jq-language.adoc
index f022840bd41..77d7fd5eb02 100644
--- a/components/camel-jq/src/main/docs/jq-language.adoc
+++ b/components/camel-jq/src/main/docs/jq-language.adoc
@@ -93,6 +93,17 @@ from("direct:start")
.to("mock:result");
----
+The `header`, `property` and `variable` functions also support returning a
default value in case the key does not exist,
+as shown in the following:
+
+[source, java]
+----
+from("direct:start")
+ .transform()
+ .jq(".foo = header(\"MyHeader\", \"MyDefaultValue\")")
+ .to("mock:result");
+----
+
=== Transforming a JSon message