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 47e55f7c16ad CAMEL-23832: camel-jsonata - improve the component and
option descriptions (#30935)
47e55f7c16ad is described below
commit 47e55f7c16ad87f6965e254db7f28347c5a9d483
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Nov 27 14:02:29 2026 +0100
CAMEL-23832: camel-jsonata - improve the component and option descriptions
(#30935)
This commit rewrites the component description, the texts of 3 component
options, 5 endpoint options and 1 header
of jsonata. The header text now says that it holds the expression itself or
the URI of a resource, that the producer
reads it only with allowTemplateFromHeader and removes it. The prettyPrint
text says it applies only to JsonString
output, and the component option texts say that they are the defaults of
the endpoint options.
Documentation only, no behavior change. The component JSON, the catalog
copy, the doc page header and the DSL are
regenerated. camel-jsonata is marked as done in
tasks/component-descriptions.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../apache/camel/catalog/components/jsonata.json | 20 +++---
.../camel/catalog/docs/jsonata-component.adoc | 2 +-
.../apache/camel/component/jsonata/jsonata.json | 20 +++---
.../src/main/docs/jsonata-component.adoc | 2 +-
.../camel/component/jsonata/JsonataComponent.java | 25 +++----
.../camel/component/jsonata/JsonataConstants.java | 4 +-
.../camel/component/jsonata/JsonataEndpoint.java | 46 +++++-------
.../component/ComponentsBuilderFactory.java | 2 +-
.../dsl/JsonataComponentBuilderFactory.java | 22 +++---
.../builder/endpoint/EndpointHeaderBuilders.java | 2 +-
.../builder/endpoint/StaticEndpointBuilders.java | 4 +-
.../dsl/JsonataEndpointBuilderFactory.java | 82 ++++++++++++----------
tasks/component-descriptions.md | 2 +-
13 files changed, 118 insertions(+), 115 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 525b7837ab0a..4dec54933dd0 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
@@ -3,7 +3,7 @@
"kind": "component",
"name": "jsonata",
"title": "JSONata",
- "description": "Transforms JSON payload using JSONata transformation.",
+ "description": "Transform JSON data with a JSONata expression.",
"deprecated": false,
"firstVersion": "3.5.0",
"label": "transformation",
@@ -24,14 +24,14 @@
"remote": false
},
"componentProperties": {
- "allowTemplateFromHeader": { "index": 0, "kind": "property",
"displayName": "Allow Template From Header", "group": "producer", "label": "",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "defaultValue": false,
"description": "Whether to allow to use resource template from header or not
(default false). Enabling this allows to specify dynamic templates via message
header. However this can be seen as a potential se [...]
- "contentCache": { "index": 1, "kind": "property", "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" },
+ "allowTemplateFromHeader": { "index": 0, "kind": "property",
"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 endpoints take the JSONata expression from the
CamelJsonataResourceUri header, when the header is set, instead of from their
resource. It is the default of the allowTemplateFromH [...]
+ "contentCache": { "index": 1, "kind": "property", "displayName": "Content
Cache", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": true, "description": "Whether the endpoints keep the
content of their resource in memory after the first load, instead of reading it
again for each exchange. It is the default of the contentCache option of each
endpoint." },
"lazyStartProducer": { "index": 2, "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 [...]
"autowiredEnabled": { "index": 3, "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 t [...]
- "frameBinding": { "index": 4, "kind": "property", "displayName": "Frame
Binding", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding",
"deprecated": false, "autowired": false, "secret": false, "description": "To
configure custom frame bindings and inject user functions." }
+ "frameBinding": { "index": 4, "kind": "property", "displayName": "Frame
Binding", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding",
"deprecated": false, "autowired": false, "secret": false, "description": "A
JsonataFrameBinding that binds custom functions and variables to the
Jsonata.Frame of each evaluation. It is used by the endpoints that do not set
their own frameBinding option." }
},
"headers": {
- "CamelJsonataResourceUri": { "index": 0, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "A URI
for the template resource to load and use instead of the endpoint configured.",
"constantName":
"org.apache.camel.component.jsonata.JsonataConstants#JSONATA_RESOURCE_URI" }
+ "CamelJsonataResourceUri": { "index": 0, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
JSONata expression to use instead of the resource of the endpoint, or the URI
of a resource that holds it, with a scheme such as classpath:, file: or http:.
The producer reads it only when allowTemplateFromHeader is true, and removes it
from the message.", [...]
},
"bodyTypes": {
"producerIn": { "carriers": [ "map", "list", "pojo", "text", "bytes",
"stream", "file" ], "format": "json", "byOption": [ { "option": "inputType",
"value": "JsonString", "carriers": [ "text", "bytes", "stream", "file" ] } ],
"description": "JSON data: a Map, a List, a JsonNode or another object Jackson
converts, or JSON as text, bytes, a stream or a file, which is parsed. Text
that does not start with { or [ is read as one JSON string. With
inputType=JsonString the body is always par [...]
@@ -40,12 +40,12 @@
"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 [...]
- "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 to allow to use resource template from header or not
(default false). Enabling this allows to specify dynamic templates via message
header. However this can be seen as a potential s [...]
+ "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": "Specifies if the
input should be Jackson JsonNode or a JSON String. With Jackson, a body that is
JSON text (its first non-whitespac [...]
- "outputType": { "index": 5, "kind": "parameter", "displayName": "Output
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": "Specifies if the
output should be Jackson JsonNode or a JSON String." },
- "prettyPrint": { "index": 6, "kind": "parameter", "displayName": "Pretty
Print", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Whether to pretty print JSon
output when using string as output type." },
+ "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 [...]
+ "outputType": { "index": 5, "kind": "parameter", "displayName": "Output
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": "The type of the
result that the producer sets as the message body: Jackson for a Jackson 3
JsonNode, or JsonString for the JSON t [...]
+ "prettyPrint": { "index": 6, "kind": "parameter", "displayName": "Pretty
Print", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Whether to format the JSON text
of the result with indentation and line breaks. It applies only when outputType
is JsonString." },
"lazyStartProducer": { "index": 7, "kind": "parameter", "displayName":
"Lazy Start Producer", "group": "producer (advanced)", "label":
"producer,advanced", "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 produc [...]
- "frameBinding": { "index": 8, "kind": "parameter", "displayName": "Frame
Binding", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding",
"deprecated": false, "autowired": false, "secret": false, "description": "To
configure the Jsonata frame binding. Allows custom functions to be added." }
+ "frameBinding": { "index": 8, "kind": "parameter", "displayName": "Frame
Binding", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding",
"deprecated": false, "autowired": false, "secret": false, "description": "A
JsonataFrameBinding that the producer calls with the Jsonata.Frame of each
evaluation, to bind custom functions and variables that the expression can use.
If not set, the frameBind [...]
}
}
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jsonata-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jsonata-component.adoc
index 21474e83385b..081273a7785e 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jsonata-component.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jsonata-component.adoc
@@ -2,7 +2,7 @@
:doctitle: JSONata
:shortname: jsonata
:artifactid: camel-jsonata
-:description: Transforms JSON payload using JSONata transformation.
+:description: Transform JSON data with a JSONata expression.
:since: 3.5
:supportlevel: Stable
:tabs-sync-option:
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 525b7837ab0a..4dec54933dd0 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
@@ -3,7 +3,7 @@
"kind": "component",
"name": "jsonata",
"title": "JSONata",
- "description": "Transforms JSON payload using JSONata transformation.",
+ "description": "Transform JSON data with a JSONata expression.",
"deprecated": false,
"firstVersion": "3.5.0",
"label": "transformation",
@@ -24,14 +24,14 @@
"remote": false
},
"componentProperties": {
- "allowTemplateFromHeader": { "index": 0, "kind": "property",
"displayName": "Allow Template From Header", "group": "producer", "label": "",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "defaultValue": false,
"description": "Whether to allow to use resource template from header or not
(default false). Enabling this allows to specify dynamic templates via message
header. However this can be seen as a potential se [...]
- "contentCache": { "index": 1, "kind": "property", "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" },
+ "allowTemplateFromHeader": { "index": 0, "kind": "property",
"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 endpoints take the JSONata expression from the
CamelJsonataResourceUri header, when the header is set, instead of from their
resource. It is the default of the allowTemplateFromH [...]
+ "contentCache": { "index": 1, "kind": "property", "displayName": "Content
Cache", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": true, "description": "Whether the endpoints keep the
content of their resource in memory after the first load, instead of reading it
again for each exchange. It is the default of the contentCache option of each
endpoint." },
"lazyStartProducer": { "index": 2, "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 [...]
"autowiredEnabled": { "index": 3, "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 t [...]
- "frameBinding": { "index": 4, "kind": "property", "displayName": "Frame
Binding", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding",
"deprecated": false, "autowired": false, "secret": false, "description": "To
configure custom frame bindings and inject user functions." }
+ "frameBinding": { "index": 4, "kind": "property", "displayName": "Frame
Binding", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding",
"deprecated": false, "autowired": false, "secret": false, "description": "A
JsonataFrameBinding that binds custom functions and variables to the
Jsonata.Frame of each evaluation. It is used by the endpoints that do not set
their own frameBinding option." }
},
"headers": {
- "CamelJsonataResourceUri": { "index": 0, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "A URI
for the template resource to load and use instead of the endpoint configured.",
"constantName":
"org.apache.camel.component.jsonata.JsonataConstants#JSONATA_RESOURCE_URI" }
+ "CamelJsonataResourceUri": { "index": 0, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
JSONata expression to use instead of the resource of the endpoint, or the URI
of a resource that holds it, with a scheme such as classpath:, file: or http:.
The producer reads it only when allowTemplateFromHeader is true, and removes it
from the message.", [...]
},
"bodyTypes": {
"producerIn": { "carriers": [ "map", "list", "pojo", "text", "bytes",
"stream", "file" ], "format": "json", "byOption": [ { "option": "inputType",
"value": "JsonString", "carriers": [ "text", "bytes", "stream", "file" ] } ],
"description": "JSON data: a Map, a List, a JsonNode or another object Jackson
converts, or JSON as text, bytes, a stream or a file, which is parsed. Text
that does not start with { or [ is read as one JSON string. With
inputType=JsonString the body is always par [...]
@@ -40,12 +40,12 @@
"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 [...]
- "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 to allow to use resource template from header or not
(default false). Enabling this allows to specify dynamic templates via message
header. However this can be seen as a potential s [...]
+ "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": "Specifies if the
input should be Jackson JsonNode or a JSON String. With Jackson, a body that is
JSON text (its first non-whitespac [...]
- "outputType": { "index": 5, "kind": "parameter", "displayName": "Output
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": "Specifies if the
output should be Jackson JsonNode or a JSON String." },
- "prettyPrint": { "index": 6, "kind": "parameter", "displayName": "Pretty
Print", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Whether to pretty print JSon
output when using string as output type." },
+ "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 [...]
+ "outputType": { "index": 5, "kind": "parameter", "displayName": "Output
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": "The type of the
result that the producer sets as the message body: Jackson for a Jackson 3
JsonNode, or JsonString for the JSON t [...]
+ "prettyPrint": { "index": 6, "kind": "parameter", "displayName": "Pretty
Print", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Whether to format the JSON text
of the result with indentation and line breaks. It applies only when outputType
is JsonString." },
"lazyStartProducer": { "index": 7, "kind": "parameter", "displayName":
"Lazy Start Producer", "group": "producer (advanced)", "label":
"producer,advanced", "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 produc [...]
- "frameBinding": { "index": 8, "kind": "parameter", "displayName": "Frame
Binding", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding",
"deprecated": false, "autowired": false, "secret": false, "description": "To
configure the Jsonata frame binding. Allows custom functions to be added." }
+ "frameBinding": { "index": 8, "kind": "parameter", "displayName": "Frame
Binding", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding",
"deprecated": false, "autowired": false, "secret": false, "description": "A
JsonataFrameBinding that the producer calls with the Jsonata.Frame of each
evaluation, to bind custom functions and variables that the expression can use.
If not set, the frameBind [...]
}
}
diff --git a/components/camel-jsonata/src/main/docs/jsonata-component.adoc
b/components/camel-jsonata/src/main/docs/jsonata-component.adoc
index 21474e83385b..081273a7785e 100644
--- a/components/camel-jsonata/src/main/docs/jsonata-component.adoc
+++ b/components/camel-jsonata/src/main/docs/jsonata-component.adoc
@@ -2,7 +2,7 @@
:doctitle: JSONata
:shortname: jsonata
:artifactid: camel-jsonata
-:description: Transforms JSON payload using JSONata transformation.
+:description: Transform JSON data with a JSONata expression.
:since: 3.5
:supportlevel: Stable
:tabs-sync-option:
diff --git
a/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataComponent.java
b/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataComponent.java
index 9ee7906295f7..6321c421dc4d 100644
---
a/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataComponent.java
+++
b/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataComponent.java
@@ -27,12 +27,19 @@ import org.apache.camel.support.ResourceHelper;
@Component("jsonata")
public class JsonataComponent extends DefaultComponent {
- @Metadata(defaultValue = "true", description = "Sets whether to use
resource content cache or not")
+ @Metadata(defaultValue = "true",
+ description = "Whether the endpoints keep the content of their
resource in memory after the first load,"
+ + " instead of reading it again for each exchange.
It is the default of the contentCache option"
+ + " of each endpoint.")
private boolean contentCache = true;
- @Metadata
+ @Metadata(description = "Whether the endpoints take the JSONata expression
from the CamelJsonataResourceUri header, when"
+ + " the header is set, instead of from their
resource. It is the default of the"
+ + " allowTemplateFromHeader option of each
endpoint. Enable it only when the header comes from a"
+ + " trusted source.")
private boolean allowTemplateFromHeader;
@Metadata(label = "advanced",
- description = "To configure custom frame bindings and inject
user functions.")
+ description = "A JsonataFrameBinding that binds custom functions
and variables to the Jsonata.Frame of each"
+ + " evaluation. It is used by the endpoints that
do not set their own frameBinding option.")
protected JsonataFrameBinding frameBinding;
public JsonataComponent() {
@@ -67,9 +74,6 @@ public class JsonataComponent extends DefaultComponent {
return contentCache;
}
- /**
- * Sets whether to use resource content cache or not
- */
public void setContentCache(boolean contentCache) {
this.contentCache = contentCache;
}
@@ -78,19 +82,10 @@ public class JsonataComponent extends DefaultComponent {
return allowTemplateFromHeader;
}
- /**
- * Whether to allow to use resource template from header or not (default
false).
- *
- * Enabling this allows to specify dynamic templates via message header.
However this can be seen as a potential
- * security vulnerability if the header is coming from a malicious user,
so use this with care.
- */
public void setAllowTemplateFromHeader(boolean allowTemplateFromHeader) {
this.allowTemplateFromHeader = allowTemplateFromHeader;
}
- /**
- * To use the custom JsonataFrameBinding to perform configuration of
custom functions that will be used.
- */
public void setFrameBinding(JsonataFrameBinding frameBinding) {
this.frameBinding = frameBinding;
}
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 fb9bee04e739..09269cf62b3c 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
@@ -23,7 +23,9 @@ import org.apache.camel.spi.Metadata;
*/
public final class JsonataConstants {
- @Metadata(description = "A URI for the template resource to load and use
instead of the endpoint configured.",
+ @Metadata(description = "The JSONata expression to use instead of the
resource of the endpoint, or the URI of a resource"
+ + " that holds it, with a scheme such as
classpath:, file: or http:. The producer reads it only"
+ + " when allowTemplateFromHeader is true, and
removes it from the message.",
javaType = "String")
public static final String JSONATA_RESOURCE_URI =
"CamelJsonataResourceUri";
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 f6d1282da27a..bf13b150c216 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
@@ -46,7 +46,7 @@ import tools.jackson.databind.json.JsonMapper;
import static com.dashjoin.jsonata.Jsonata.jsonata;
/**
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*/
@UriEndpoint(firstVersion = "3.5.0", scheme = "jsonata", title = "JSONata",
syntax = "jsonata:resourceUri",
producerOnly = true, remote = false,
@@ -75,15 +75,28 @@ public class JsonataEndpoint extends ResourceEndpoint {
// keeps the Jackson 2 defaults, so the input of the expression and its
output do not change
private final ObjectMapper mapper =
JsonMapper.builderWithJackson2Defaults().build();
- @UriParam(defaultValue = "Jackson")
+ @UriParam(defaultValue = "Jackson",
+ description = "The type of the result that the producer sets as
the message body: Jackson for a Jackson 3"
+ + " JsonNode, or JsonString for the JSON text.")
private JsonataInputOutputType outputType;
- @UriParam(defaultValue = "Jackson")
+ @UriParam(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-whitespace
character is { or [), bytes, a stream or a file"
+ + " is parsed as JSON, other text is a JSON string
value, and any other body, such as a Map or a"
+ + " List, is converted by Jackson. With
JsonString, the body is always parsed as JSON.")
private JsonataInputOutputType inputType;
- @UriParam(label = "advanced", description = "To configure the Jsonata
frame binding. Allows custom functions to be added.")
+ @UriParam(label = "advanced",
+ description = "A JsonataFrameBinding that the producer calls
with the Jsonata.Frame of each evaluation, to bind"
+ + " custom functions and variables that the
expression can use. If not set, the frameBinding"
+ + " option of the component is used.")
private JsonataFrameBinding frameBinding;
- @UriParam
+ @UriParam(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 comes from a trusted source, as its
value can be any expression or the URI of any"
+ + " resource that Camel can read.")
private boolean allowTemplateFromHeader;
- @UriParam
+ @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;
public JsonataEndpoint() {
@@ -113,9 +126,6 @@ public class JsonataEndpoint extends ResourceEndpoint {
return outputType;
}
- /**
- * Specifies if the output should be Jackson JsonNode or a JSON String.
- */
public void setOutputType(JsonataInputOutputType outputType) {
this.outputType = outputType;
}
@@ -124,19 +134,10 @@ public class JsonataEndpoint extends ResourceEndpoint {
return inputType;
}
- /**
- * Specifies if the input should be Jackson JsonNode or a JSON String.
With Jackson, a body that is JSON text (its
- * first non-whitespace character is { or [), bytes, a stream or a file is
parsed as JSON, other text is a JSON
- * string value, and any other body, such as a Map or a List, is converted
by Jackson. With JsonString, the body is
- * always parsed as JSON.
- */
public void setInputType(JsonataInputOutputType inputType) {
this.inputType = inputType;
}
- /**
- * Specifies the custom framebinding.
- */
public void setFrameBinding(JsonataFrameBinding frameBinding) {
this.frameBinding = frameBinding;
}
@@ -149,12 +150,6 @@ public class JsonataEndpoint extends ResourceEndpoint {
return allowTemplateFromHeader;
}
- /**
- * Whether to allow to use resource template from header or not (default
false).
- *
- * Enabling this allows to specify dynamic templates via message header.
However this can be seen as a potential
- * security vulnerability if the header is coming from a malicious user,
so use this with care.
- */
public void setAllowTemplateFromHeader(boolean allowTemplateFromHeader) {
this.allowTemplateFromHeader = allowTemplateFromHeader;
}
@@ -163,9 +158,6 @@ public class JsonataEndpoint extends ResourceEndpoint {
return prettyPrint;
}
- /**
- * Whether to pretty print JSon output when using string as output type.
- */
public void setPrettyPrint(boolean prettyPrint) {
this.prettyPrint = prettyPrint;
}
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index d8bc11cbf01d..b0ef67d76f69 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -3052,7 +3052,7 @@ public interface ComponentsBuilderFactory {
}
/**
* JSONata (camel-jsonata)
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Category: transformation
* Since: 3.5
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JsonataComponentBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JsonataComponentBuilderFactory.java
index c776f0411781..3d01899d2051 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JsonataComponentBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JsonataComponentBuilderFactory.java
@@ -24,7 +24,7 @@ import org.apache.camel.builder.component.ComponentBuilder;
import org.apache.camel.component.jsonata.JsonataComponent;
/**
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Generated by camel build tools - do NOT edit this file!
*/
@@ -33,7 +33,7 @@ public interface JsonataComponentBuilderFactory {
/**
* JSONata (camel-jsonata)
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Category: transformation
* Since: 3.5
@@ -52,11 +52,11 @@ public interface JsonataComponentBuilderFactory {
/**
- * Whether to allow to use resource template from header or not
(default
- * false). Enabling this allows to specify dynamic templates via
message
- * header. However this can be seen as a potential security
- * vulnerability if the header is coming from a malicious user, so use
- * this with care.
+ * Whether the endpoints take the JSONata expression from the
+ * CamelJsonataResourceUri header, when the header is set, instead of
+ * from their resource. It is the default of the
allowTemplateFromHeader
+ * option of each endpoint. Enable it only when the header comes from a
+ * trusted source.
*
* The option is a: <code>boolean</code> type.
*
@@ -73,7 +73,9 @@ public interface JsonataComponentBuilderFactory {
/**
- * Sets whether to use resource content cache or not.
+ * Whether the endpoints keep the content of their resource in memory
+ * after the first load, instead of reading it again for each exchange.
+ * It is the default of the contentCache option of each endpoint.
*
* The option is a: <code>boolean</code> type.
*
@@ -136,7 +138,9 @@ public interface JsonataComponentBuilderFactory {
}
/**
- * To configure custom frame bindings and inject user functions.
+ * A JsonataFrameBinding that binds custom functions and variables to
+ * the Jsonata.Frame of each evaluation. It is used by the endpoints
+ * that do not set their own frameBinding option.
*
* The option is a:
*
<code>org.apache.camel.component.jsonata.JsonataFrameBinding</code>
type.
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java
index 495bf3b793a2..7b0966c0667d 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java
@@ -2431,7 +2431,7 @@ public class EndpointHeaderBuilders {
}
/**
* JSONata (camel-jsonata)
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Category: transformation
* Since: 3.5
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index ae1c2f59a5b4..c0655757238a 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -9958,7 +9958,7 @@ public class StaticEndpointBuilders {
}
/**
* JSONata (camel-jsonata)
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Category: transformation
* Since: 3.5
@@ -9983,7 +9983,7 @@ public class StaticEndpointBuilders {
}
/**
* JSONata (camel-jsonata)
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Category: transformation
* Since: 3.5
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 c3d36ddb25c5..fe27f1e3a5e7 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
@@ -27,7 +27,7 @@ import org.apache.camel.builder.EndpointProducerBuilder;
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
/**
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Generated by camel build tools - do NOT edit this file!
*/
@@ -83,11 +83,11 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * Whether to allow to use resource template from header or not
(default
- * false). Enabling this allows to specify dynamic templates via
message
- * header. However this can be seen as a potential security
- * vulnerability if the header is coming from a malicious user, so use
- * this with care.
+ * 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 comes
+ * from a trusted source, as its value can be any expression or the URI
+ * of any resource that Camel can read.
*
* The option is a: <code>boolean</code> type.
*
@@ -102,11 +102,11 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * Whether to allow to use resource template from header or not
(default
- * false). Enabling this allows to specify dynamic templates via
message
- * header. However this can be seen as a potential security
- * vulnerability if the header is coming from a malicious user, so use
- * this with care.
+ * 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 comes
+ * from a trusted source, as its value can be any expression or the URI
+ * of any resource that Camel can read.
*
* The option will be converted to a <code>boolean</code> type.
*
@@ -151,12 +151,12 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * Specifies if the input should be Jackson JsonNode or a JSON String.
- * With Jackson, a body that is JSON text (its first non-whitespace
- * character is { or [), bytes, a stream or a file is parsed as JSON,
- * other text is a JSON string value, and any other body, such as a Map
- * or a List, is converted by Jackson. With JsonString, the body is
- * always parsed as JSON.
+ * How the producer reads the message body as the input of the
+ * expression. With Jackson, a body that is JSON text (its first
+ * non-whitespace character is { or [), bytes, a stream or a file is
+ * parsed as JSON, other text is a JSON string value, and any other
+ * body, such as a Map or a List, is converted by Jackson. With
+ * JsonString, the body is always parsed as JSON.
*
* The option is a:
*
<code>org.apache.camel.component.jsonata.JsonataInputOutputType</code> type.
@@ -172,12 +172,12 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * Specifies if the input should be Jackson JsonNode or a JSON String.
- * With Jackson, a body that is JSON text (its first non-whitespace
- * character is { or [), bytes, a stream or a file is parsed as JSON,
- * other text is a JSON string value, and any other body, such as a Map
- * or a List, is converted by Jackson. With JsonString, the body is
- * always parsed as JSON.
+ * How the producer reads the message body as the input of the
+ * expression. With Jackson, a body that is JSON text (its first
+ * non-whitespace character is { or [), bytes, a stream or a file is
+ * parsed as JSON, other text is a JSON string value, and any other
+ * body, such as a Map or a List, is converted by Jackson. With
+ * JsonString, the body is always parsed as JSON.
*
* The option will be converted to a
*
<code>org.apache.camel.component.jsonata.JsonataInputOutputType</code> type.
@@ -193,7 +193,8 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * Specifies if the output should be Jackson JsonNode or a JSON String.
+ * The type of the result that the producer sets as the message body:
+ * Jackson for a Jackson 3 JsonNode, or JsonString for the JSON text.
*
* The option is a:
*
<code>org.apache.camel.component.jsonata.JsonataInputOutputType</code> type.
@@ -209,7 +210,8 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * Specifies if the output should be Jackson JsonNode or a JSON String.
+ * The type of the result that the producer sets as the message body:
+ * Jackson for a Jackson 3 JsonNode, or JsonString for the JSON text.
*
* The option will be converted to a
*
<code>org.apache.camel.component.jsonata.JsonataInputOutputType</code> type.
@@ -225,7 +227,8 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * Whether to pretty print JSon output when using string as output
type.
+ * Whether to format the JSON text of the result with indentation and
+ * line breaks. It applies only when outputType is JsonString.
*
* The option is a: <code>boolean</code> type.
*
@@ -240,7 +243,8 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * Whether to pretty print JSon output when using string as output
type.
+ * Whether to format the JSON text of the result with indentation and
+ * line breaks. It applies only when outputType is JsonString.
*
* The option will be converted to a <code>boolean</code> type.
*
@@ -313,8 +317,10 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * To configure the Jsonata frame binding. Allows custom functions to
be
- * added.
+ * A JsonataFrameBinding that the producer calls with the Jsonata.Frame
+ * of each evaluation, to bind custom functions and variables that the
+ * expression can use. If not set, the frameBinding option of the
+ * component is used.
*
* The option is a:
* <code>org.apache.camel.component.jsonata.JsonataFrameBinding</code>
@@ -330,8 +336,10 @@ public interface JsonataEndpointBuilderFactory {
return this;
}
/**
- * To configure the Jsonata frame binding. Allows custom functions to
be
- * added.
+ * A JsonataFrameBinding that the producer calls with the Jsonata.Frame
+ * of each evaluation, to bind custom functions and variables that the
+ * expression can use. If not set, the frameBinding option of the
+ * component is used.
*
* The option will be converted to a
* <code>org.apache.camel.component.jsonata.JsonataFrameBinding</code>
@@ -351,7 +359,7 @@ public interface JsonataEndpointBuilderFactory {
public interface JsonataBuilders {
/**
* JSONata (camel-jsonata)
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Category: transformation
* Since: 3.5
@@ -364,7 +372,7 @@ public interface JsonataEndpointBuilderFactory {
}
/**
* JSONata (camel-jsonata)
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Category: transformation
* Since: 3.5
@@ -390,7 +398,7 @@ public interface JsonataEndpointBuilderFactory {
}
/**
* JSONata (camel-jsonata)
- * Transforms JSON payload using JSONata transformation.
+ * Transform JSON data with a JSONata expression.
*
* Category: transformation
* Since: 3.5
@@ -429,8 +437,10 @@ public interface JsonataEndpointBuilderFactory {
public static final JsonataHeaderNameBuilder INSTANCE = new
JsonataHeaderNameBuilder();
/**
- * A URI for the template resource to load and use instead of the
- * endpoint configured.
+ * The JSONata expression to use instead of the resource of the
+ * endpoint, or the URI of a resource that holds it, with a scheme such
+ * as classpath:, file: or http:. The producer reads it only when
+ * allowTemplateFromHeader is true, and removes it from the message.
*
* The option is a: {@code String} type.
*
diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md
index 06763a59af33..7c506c4c9762 100644
--- a/tasks/component-descriptions.md
+++ b/tasks/component-descriptions.md
@@ -241,7 +241,7 @@ or removes its row.
| camel-jsch | scp | |
| camel-jslt | jslt | |
| camel-json-validator | json-validator | |
-| camel-jsonata | jsonata | |
+| camel-jsonata | jsonata | yes |
| camel-jt400 | jt400 | |
| camel-jte | jte | |
| camel-kafka | kafka | |