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 0ab9de4a7edd CAMEL-27607: camel-jsonata - open the resource only 
without a header template, deprecate unused options (#30986)
0ab9de4a7edd is described below

commit 0ab9de4a7edd83ade82f9e07ac85f0cbc10b5951
Author: allthingssecurity <[email protected]>
AuthorDate: Sat Nov 28 12:58:48 2026 +0530

    CAMEL-27607: camel-jsonata - open the resource only without a header 
template, deprecate unused options (#30986)
    
    1. JsonataEndpoint.onExchange() opened the resource of the endpoint before 
it
       read the CamelJsonataResourceUri header. With allowTemplateFromHeader and
       the header set, that stream was replaced and never closed (one leaked
       resource stream per exchange with contentCache=false), and a missing
       endpoint resource failed the exchange although the expression came from
       the header. The header is now read first, and the endpoint resource is
       opened only when the header does not replace it.
    
    2. Not changed: the expression is still parsed for each exchange. Keeping
       one parsed expression per endpoint is not safe with dashjoin jsonata
       0.9.10. $now() and $millis() read the timestamp of a per-thread copy of
       the expression (the static ThreadLocal Jsonata.current), and the copy is
       taken once, on the first evaluation on that thread. With a shared parsed
       expression, every thread other than the one that parsed it would return
       the time of its first evaluation forever. This needs a change in dashjoin
       jsonata first.
    
    3. allowContextMapAll, inherited from ResourceEndpoint, does nothing in
       jsonata. JsonataEndpoint now declares the option itself, marked
       deprecated, with a description that says it has no effect. It stays in
       the metadata and in the endpoint DSL, so code that sets it keeps
       compiling and working.
    
    4. JsonataConstants.JSONATA_CONTEXT (CamelJsonataContext) is not read by the
       producer. It is deprecated rather than removed, so code that references
       it still compiles, and the three tests that set the header no longer do.
    
    Regenerated jsonata.json (component and catalog copy) and the endpoint
    DSL. Upgrade guide entry for 4.24 for the two deprecations.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 .../apache/camel/catalog/components/jsonata.json   |   2 +-
 .../apache/camel/component/jsonata/jsonata.json    |   2 +-
 .../camel/component/jsonata/JsonataConstants.java  |   4 +
 .../camel/component/jsonata/JsonataEndpoint.java   |  35 ++++++-
 .../component/jsonata/JsonataArrayInputTest.java   |  10 --
 .../jsonata/JsonataExpressionResourceTest.java     | 109 +++++++++++++++++++++
 .../component/jsonata/JsonataFirstSampleTest.java  |  12 ---
 .../jsonata/JsonataJacksonOutputTest.java          |  12 ---
 .../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc    |  13 +++
 .../dsl/JsonataEndpointBuilderFactory.java         |  16 ++-
 10 files changed, 168 insertions(+), 47 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jsonata.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jsonata.json
index 4dec54933dd0..66b02545a87a 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jsonata.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jsonata.json
@@ -39,7 +39,7 @@
   },
   "properties": {
     "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource 
Uri", "group": "producer", "label": "", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "supportFileReference": true, "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  [...]
-    "allowContextMapAll": { "index": 1, "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 C [...]
+    "allowContextMapAll": { "index": 1, "kind": "parameter", "displayName": 
"Allow Context Map All", "group": "producer", "label": "", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": true, 
"deprecationNote": "The jsonata component builds no context map, so this option 
has no effect.", "autowired": false, "secret": false, "defaultValue": false, 
"description": "Not used by jsonata. Deprecation note: The jsonata component 
builds no context map, so this option has  [...]
     "allowTemplateFromHeader": { "index": 2, "kind": "parameter", 
"displayName": "Allow Template From Header", "group": "producer", "label": "", 
"required": false, "type": "boolean", "javaType": "boolean", "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": false, 
"description": "Whether the producer takes the JSONata expression from the 
CamelJsonataResourceUri header, when the header is set, instead of from the 
resourceUri option. Enable it only when the header com [...]
     "contentCache": { "index": 3, "kind": "parameter", "displayName": "Content 
Cache", "group": "producer", "label": "", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "autowired": false, "secret": 
false, "defaultValue": true, "description": "Sets whether to use resource 
content cache or not" },
     "inputType": { "index": 4, "kind": "parameter", "displayName": "Input 
Type", "group": "producer", "label": "", "required": false, "type": "enum", 
"javaType": "org.apache.camel.component.jsonata.JsonataInputOutputType", 
"enum": [ "Jackson", "JsonString" ], "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "Jackson", "description": "How the producer 
reads the message body as the input of the expression. With Jackson, a body 
that is JSON text (its first non-white [...]
diff --git 
a/components/camel-jsonata/src/generated/resources/META-INF/org/apache/camel/component/jsonata/jsonata.json
 
b/components/camel-jsonata/src/generated/resources/META-INF/org/apache/camel/component/jsonata/jsonata.json
index 4dec54933dd0..66b02545a87a 100644
--- 
a/components/camel-jsonata/src/generated/resources/META-INF/org/apache/camel/component/jsonata/jsonata.json
+++ 
b/components/camel-jsonata/src/generated/resources/META-INF/org/apache/camel/component/jsonata/jsonata.json
@@ -39,7 +39,7 @@
   },
   "properties": {
     "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource 
Uri", "group": "producer", "label": "", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "supportFileReference": true, "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  [...]
-    "allowContextMapAll": { "index": 1, "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 C [...]
+    "allowContextMapAll": { "index": 1, "kind": "parameter", "displayName": 
"Allow Context Map All", "group": "producer", "label": "", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": true, 
"deprecationNote": "The jsonata component builds no context map, so this option 
has no effect.", "autowired": false, "secret": false, "defaultValue": false, 
"description": "Not used by jsonata. Deprecation note: The jsonata component 
builds no context map, so this option has  [...]
     "allowTemplateFromHeader": { "index": 2, "kind": "parameter", 
"displayName": "Allow Template From Header", "group": "producer", "label": "", 
"required": false, "type": "boolean", "javaType": "boolean", "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": false, 
"description": "Whether the producer takes the JSONata expression from the 
CamelJsonataResourceUri header, when the header is set, instead of from the 
resourceUri option. Enable it only when the header com [...]
     "contentCache": { "index": 3, "kind": "parameter", "displayName": "Content 
Cache", "group": "producer", "label": "", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "autowired": false, "secret": 
false, "defaultValue": true, "description": "Sets whether to use resource 
content cache or not" },
     "inputType": { "index": 4, "kind": "parameter", "displayName": "Input 
Type", "group": "producer", "label": "", "required": false, "type": "enum", 
"javaType": "org.apache.camel.component.jsonata.JsonataInputOutputType", 
"enum": [ "Jackson", "JsonString" ], "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "Jackson", "description": "How the producer 
reads the message body as the input of the expression. With Jackson, a body 
that is JSON text (its first non-white [...]
diff --git 
a/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataConstants.java
 
b/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataConstants.java
index 09269cf62b3c..0729cab77df0 100644
--- 
a/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataConstants.java
+++ 
b/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataConstants.java
@@ -29,6 +29,10 @@ public final class JsonataConstants {
               javaType = "String")
     public static final String JSONATA_RESOURCE_URI = 
"CamelJsonataResourceUri";
 
+    /**
+     * @deprecated not used: the producer does not read this header.
+     */
+    @Deprecated(since = "4.24.0")
     public static final String JSONATA_CONTEXT = "CamelJsonataContext";
 
     private JsonataConstants() {
diff --git 
a/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataEndpoint.java
 
b/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataEndpoint.java
index bf13b150c216..d5818ef98a96 100644
--- 
a/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataEndpoint.java
+++ 
b/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataEndpoint.java
@@ -35,6 +35,7 @@ import org.apache.camel.component.ResourceEndpoint;
 import org.apache.camel.spi.BodyType;
 import org.apache.camel.spi.BodyType.Carrier;
 import org.apache.camel.spi.BodyTypes;
+import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.ExchangeHelper;
@@ -98,6 +99,11 @@ public class JsonataEndpoint extends ResourceEndpoint {
     @UriParam(description = "Whether to format the JSON text of the result 
with indentation and line breaks. It applies"
                             + " only when outputType is JsonString.")
     private boolean prettyPrint;
+    // shadows the option of ResourceEndpoint, so it can be marked deprecated 
for jsonata only
+    @UriParam(defaultValue = "false", description = "Not used by jsonata.")
+    @Metadata(deprecationNote = "The jsonata component builds no context map, 
so this option has no effect.")
+    @Deprecated(since = "4.24.0")
+    private boolean allowContextMapAll;
 
     public JsonataEndpoint() {
     }
@@ -162,6 +168,29 @@ public class JsonataEndpoint extends ResourceEndpoint {
         this.prettyPrint = prettyPrint;
     }
 
+    /**
+     * Not used by jsonata.
+     *
+     * @deprecated this option has no effect in jsonata
+     */
+    @Deprecated(since = "4.24.0")
+    @Override
+    public boolean isAllowContextMapAll() {
+        return allowContextMapAll;
+    }
+
+    /**
+     * Not used by jsonata. The component builds no context map, so this 
option has no effect.
+     *
+     * @deprecated this option has no effect in jsonata
+     */
+    @Deprecated(since = "4.24.0")
+    @Override
+    public void setAllowContextMapAll(boolean allowContextMapAll) {
+        super.setAllowContextMapAll(allowContextMapAll);
+        this.allowContextMapAll = allowContextMapAll;
+    }
+
     @Override
     protected void onExchange(Exchange exchange) throws Exception {
         String path = getResourceUri();
@@ -175,7 +204,7 @@ public class JsonataEndpoint extends ResourceEndpoint {
             input = jacksonInput(exchange);
         }
 
-        InputStream is = getResourceAsInputStream();
+        InputStream is = null;
         if (allowTemplateFromHeader) {
             String newResourceUri = 
exchange.getIn().getHeader(JsonataConstants.JSONATA_RESOURCE_URI, String.class);
             if (newResourceUri != null) {
@@ -187,6 +216,10 @@ public class JsonataEndpoint extends ResourceEndpoint {
                 }
             }
         }
+        if (is == null) {
+            // the resource of the endpoint is opened only when the header 
does not replace it
+            is = getResourceAsInputStream();
+        }
         Jsonata expression;
         try (InputStreamReader inputStreamReader
                 = new InputStreamReader(is, StandardCharsets.UTF_8);
diff --git 
a/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataArrayInputTest.java
 
b/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataArrayInputTest.java
index 582d47da786b..63810617ca2b 100644
--- 
a/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataArrayInputTest.java
+++ 
b/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataArrayInputTest.java
@@ -17,10 +17,7 @@
 package org.apache.camel.component.jsonata;
 
 import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
 
-import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.support.ResourceHelper;
@@ -72,19 +69,12 @@ class JsonataArrayInputTest extends CamelTestSupport {
 
     @Override
     protected RouteBuilder createRouteBuilder() {
-        final Processor processor = exchange -> {
-            Map<String, String> contextMap = new HashMap<>();
-            exchange.getIn().setHeader(JsonataConstants.JSONATA_CONTEXT, 
contextMap);
-        };
-
         return new RouteBuilder() {
             public void configure() {
                 from("direct://start-string")
-                        .process(processor)
                         
.to("jsonata:org/apache/camel/component/jsonata/arrayinput/expressions.spec?inputType=JsonString&outputType=JsonString")
                         .to("mock:result");
                 from("direct://start-jackson")
-                        .process(processor)
                         
.to("jsonata:org/apache/camel/component/jsonata/arrayinput/expressions.spec?inputType=Jackson&outputType=JsonString")
                         .to("mock:result");
             }
diff --git 
a/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataExpressionResourceTest.java
 
b/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataExpressionResourceTest.java
new file mode 100644
index 000000000000..9fedfb238684
--- /dev/null
+++ 
b/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataExpressionResourceTest.java
@@ -0,0 +1,109 @@
+/*
+ * 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.jsonata;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.camel.CatalogCamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import tools.jackson.databind.JsonNode;
+import tools.jackson.databind.json.JsonMapper;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Tests that the producer opens the resource of the endpoint only when no 
header replaces it, and that the deprecated
+ * allowContextMapAll option, which jsonata never uses, still works.
+ */
+class JsonataExpressionResourceTest extends CamelTestSupport {
+
+    private static final String SPEC = 
"classpath:org/apache/camel/component/jsonata/firstSample/expressions.spec";
+
+    @Test
+    void headerExpressionDoesNotNeedTheEndpointResource() {
+        // the endpoint resource was opened before the header was read, so a 
missing resource failed the exchange
+        Exchange result = template.request(
+                
"jsonata:classpath:org/apache/camel/component/jsonata/missing.spec"
+                                           + 
"?allowTemplateFromHeader=true&contentCache=false&outputType=JsonString",
+                exchange -> {
+                    
exchange.getIn().setHeader(JsonataConstants.JSONATA_RESOURCE_URI, "name");
+                    exchange.getIn().setBody("{\"name\":\"Camel\"}");
+                });
+
+        assertNull(result.getException(), () -> "the exchange failed with " + 
result.getException());
+        assertEquals("\"Camel\"", result.getMessage().getBody(String.class));
+    }
+
+    @Test
+    void endpointResourceIsOpenedOnlyWithoutHeaderExpression() throws 
Exception {
+        AtomicInteger opened = new AtomicInteger();
+        AtomicInteger closed = new AtomicInteger();
+        JsonataComponent component = context.getComponent("jsonata", 
JsonataComponent.class);
+        JsonataEndpoint endpoint = new JsonataEndpoint("jsonata:counting", 
component, "counting", null) {
+            @Override
+            protected InputStream loadResource(String uri) {
+                opened.incrementAndGet();
+                return new 
ByteArrayInputStream("name".getBytes(StandardCharsets.UTF_8)) {
+                    @Override
+                    public void close() {
+                        closed.incrementAndGet();
+                    }
+                };
+            }
+        };
+        endpoint.setContentCache(false);
+        endpoint.setAllowTemplateFromHeader(true);
+        endpoint.setOutputType(JsonataInputOutputType.JsonString);
+        context.addEndpoint("jsonata:counting", endpoint);
+
+        Exchange fromHeader = template.request(endpoint, exchange -> {
+            exchange.getIn().setHeader(JsonataConstants.JSONATA_RESOURCE_URI, 
"name");
+            exchange.getIn().setBody("{\"name\":\"Camel\"}");
+        });
+
+        // the stream of the endpoint resource was opened and then replaced by 
the header, so it was never closed
+        assertNull(fromHeader.getException(), () -> "the exchange failed with 
" + fromHeader.getException());
+        assertEquals(0, opened.get(), "the endpoint resource is not opened 
when the header replaces it");
+
+        Exchange fromResource = template.request(endpoint, exchange -> 
exchange.getIn().setBody("{\"name\":\"Camel\"}"));
+
+        assertNull(fromResource.getException(), () -> "the exchange failed 
with " + fromResource.getException());
+        assertEquals("\"Camel\"", 
fromResource.getMessage().getBody(String.class));
+        assertEquals(1, opened.get());
+        assertEquals(1, closed.get(), "the stream of the endpoint resource is 
closed");
+    }
+
+    @Test
+    void allowContextMapAllIsDeprecated() throws Exception {
+        // jsonata never builds a context map, so the option inherited from 
ResourceEndpoint has no effect
+        JsonNode option = JsonMapper.builder().build()
+                .readTree(((CatalogCamelContext) 
context).getComponentParameterJsonSchema("jsonata"))
+                .path("properties").path("allowContextMapAll");
+        assertTrue(option.path("deprecated").asBoolean(), () -> 
"allowContextMapAll is not deprecated: " + option);
+
+        // a uri that sets the option keeps working
+        assertNotNull(context.getEndpoint("jsonata:" + SPEC + 
"?allowContextMapAll=true", JsonataEndpoint.class));
+    }
+}
diff --git 
a/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataFirstSampleTest.java
 
b/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataFirstSampleTest.java
index f41f7410fbb1..5ad30133636a 100644
--- 
a/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataFirstSampleTest.java
+++ 
b/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataFirstSampleTest.java
@@ -16,10 +16,6 @@
  */
 package org.apache.camel.component.jsonata;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.support.ResourceHelper;
@@ -51,17 +47,9 @@ class JsonataFirstSampleTest extends CamelTestSupport {
 
     @Override
     protected RouteBuilder createRouteBuilder() {
-        final Processor processor = exchange -> {
-            Map<String, String> contextMap = new HashMap<>();
-            contextMap.put("contextB", "bb");
-
-            exchange.getIn().setHeader(JsonataConstants.JSONATA_CONTEXT, 
contextMap);
-        };
-
         return new RouteBuilder() {
             public void configure() {
                 from("direct://start")
-                        .process(processor)
                         
.to("jsonata:org/apache/camel/component/jsonata/firstSample/expressions.spec?inputType=JsonString&outputType=JsonString")
                         .to("mock:result");
             }
diff --git 
a/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataJacksonOutputTest.java
 
b/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataJacksonOutputTest.java
index d526ceabd5c8..d20ef19710b4 100644
--- 
a/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataJacksonOutputTest.java
+++ 
b/components/camel-jsonata/src/test/java/org/apache/camel/component/jsonata/JsonataJacksonOutputTest.java
@@ -16,10 +16,6 @@
  */
 package org.apache.camel.component.jsonata;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.support.ResourceHelper;
@@ -51,18 +47,10 @@ class JsonataJacksonOutputTest extends CamelTestSupport {
 
     @Override
     protected RouteBuilder createRouteBuilder() {
-        final Processor processor = exchange -> {
-            Map<String, String> contextMap = new HashMap<>();
-            contextMap.put("contextB", "bb");
-
-            exchange.getIn().setHeader(JsonataConstants.JSONATA_CONTEXT, 
contextMap);
-        };
-
         return new RouteBuilder() {
             @Override
             public void configure() {
                 from("direct://start")
-                        .process(processor)
                         
.to("jsonata:org/apache/camel/component/jsonata/firstSample/expressions.spec?inputType=JsonString&outputType=Jackson")
                         .to("mock:result");
             }
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index 3b7eb5e2f38e..e8d599480e50 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -704,6 +704,19 @@ Before, its lock failed with an `OptimisticLockException`, 
and the poll was roll
 
 Other JPA providers, and the optimistic lock modes, are not affected.
 
+=== camel-jsonata - allowContextMapAll and CamelJsonataContext are deprecated
+
+The `allowContextMapAll` option of the `jsonata` endpoint is deprecated. It is 
inherited from the resource endpoints
+of Camel, but jsonata never builds a context map, so the option had no effect. 
A uri or endpoint DSL code that sets it
+keeps working.
+
+The `JsonataConstants.JSONATA_CONTEXT` constant (`CamelJsonataContext` header) 
is deprecated, as the producer never
+read that header. Setting it has no effect, as before.
+
+The producer now opens the resource of the endpoint only when the 
`CamelJsonataResourceUri` header does not replace
+it. With `allowTemplateFromHeader=true`, an exchange that brings its 
expression in that header no longer fails when
+the resource of the endpoint cannot be found.
+
 === camel-vertx-http - an https:// address always uses TLS
 
 A `vertx-http` endpoint with an `https://` address now always calls it with 
TLS, also when no `sslContextParameters`
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JsonataEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JsonataEndpointBuilderFactory.java
index fe27f1e3a5e7..e53c0469c06f 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JsonataEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JsonataEndpointBuilderFactory.java
@@ -45,11 +45,8 @@ public interface JsonataEndpointBuilderFactory {
         }
 
         /**
-         * 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. Doing so impose a potential security risk as this 
opens
-         * access to the full power of CamelContext API.
+         * Not used by jsonata. Deprecation note: The jsonata component builds
+         * no context map, so this option has no effect.
          * 
          * The option is a: <code>boolean</code> type.
          * 
@@ -59,16 +56,14 @@ public interface JsonataEndpointBuilderFactory {
          * @param allowContextMapAll the value to set
          * @return the dsl builder
          */
+        @Deprecated
         default JsonataEndpointBuilder allowContextMapAll(boolean 
allowContextMapAll) {
             doSetProperty("allowContextMapAll", allowContextMapAll);
             return this;
         }
         /**
-         * 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. Doing so impose a potential security risk as this 
opens
-         * access to the full power of CamelContext API.
+         * Not used by jsonata. Deprecation note: The jsonata component builds
+         * no context map, so this option has no effect.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 
@@ -78,6 +73,7 @@ public interface JsonataEndpointBuilderFactory {
          * @param allowContextMapAll the value to set
          * @return the dsl builder
          */
+        @Deprecated
         default JsonataEndpointBuilder allowContextMapAll(String 
allowContextMapAll) {
             doSetProperty("allowContextMapAll", allowContextMapAll);
             return this;

Reply via email to