You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/10/05 17:08:16 UTC
(camel) branch camel-4.22.x updated: [backport camel-4.22.x] CAMEL-25054/CAMEL-25205: camel-jackson3 and camel-jackson3xml (#26937 #27156) (#27152)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-4.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.22.x by this push:
new 06f55f3b59d0 [backport camel-4.22.x] CAMEL-25054/CAMEL-25205: camel-jackson3 and camel-jackson3xml (#26937 #27156) (#27152)
06f55f3b59d0 is described below
commit 06f55f3b59d0fb57d4733c7ae6ecf939b237ca59
Author: Benjamin Graf <gr...@users.noreply.github.com>
AuthorDate: Mon Oct 5 19:08:09 2026 +0200
[backport camel-4.22.x] CAMEL-25054/CAMEL-25205: camel-jackson3 and camel-jackson3xml (#26937 #27156) (#27152)
---
.../apache/camel/catalog/dataformats/jackson.json | 4 +-
.../camel/catalog/dataformats/jacksonXml.json | 4 +-
.../apache/camel/catalog/models/jacksonXml.json | 4 +-
.../org/apache/camel/catalog/models/json.json | 4 +-
.../apache/camel/catalog/schemas/camel-spring.xsd | 18 +-
.../apache/camel/catalog/schemas/camel-xml-io.xsd | 18 +-
.../camel/catalog/schemas/camelYamlDsl-model.json | 8 +-
.../apache/camel/component/jackson/jackson.json | 4 +-
.../apache/camel/component/jackson3/jackson.json | 4 +-
.../jackson3/AbstractJacksonDataFormat.java | 328 ++++++++-------
.../component/jackson3/JacksonFeaturesTest.java | 63 +++
.../jackson3xml/JacksonXMLDataFormat.java | 450 ++++++++++++++++-----
.../jackson3xml/ListJacksonXMLDataFormat.java | 2 +-
.../component/jackson3xml/JacksonFeaturesTest.java | 117 ++++++
.../camel/component/jacksonxml/jacksonXml.json | 4 +-
.../apache/camel/model/dataformat/jacksonXml.json | 4 +-
.../org/apache/camel/model/dataformat/json.json | 4 +-
.../model/dataformat/JacksonXMLDataFormat.java | 10 +-
.../camel/model/dataformat/JsonDataFormat.java | 6 +-
.../dsl/yaml/deserializers/ModelDeserializers.java | 8 +-
.../resources/schema/camelYamlDsl-canonical.json | 8 +-
.../resources/schema/camelYamlDsl-model.json | 8 +-
.../generated/resources/schema/camelYamlDsl.json | 8 +-
23 files changed, 789 insertions(+), 299 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json
index ee25633c82fe..0d7a775bba06 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json
@@ -30,8 +30,8 @@
"useList": { "index": 11, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." },
"moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." },
"moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
- "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
- "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
+ "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. Seri [...]
+ "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. S [...]
"allowUnmarshallType": { "index": 16, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used." },
"timezone": { "index": 17, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." },
"schemaResolver": { "index": 18, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json
index fde717538389..a664df243048 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json
@@ -30,8 +30,8 @@
"enableJaxbAnnotationModule": { "index": 11, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using Jackson. When enabled then JAXB annotations can be used by Jackson." },
"moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." },
"moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
- "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separate [...]
- "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separ [...]
+ "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNo [...]
+ "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, Jso [...]
"contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
"maxStringLength": { "index": 17, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum allowed string length when deserializing (in chars or bytes, depending on input context). The default is 20,000,000." }
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json
index 9d1ee0e2e9ca..ae60295e87f8 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json
@@ -27,8 +27,8 @@
"enableJaxbAnnotationModule": { "index": 11, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using Jackson. When enabled then JAXB annotations can be used by Jackson." },
"moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." },
"moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
- "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separate [...]
- "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separ [...]
+ "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNo [...]
+ "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, Jso [...]
"contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
"maxStringLength": { "index": 17, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum allowed string length when deserializing (in chars or bytes, depending on input context). The default is 20,000,000." }
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json
index f42ba35001f4..ebabe678aede 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json
@@ -27,8 +27,8 @@
"useList": { "index": 12, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." },
"moduleClassNames": { "index": 13, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." },
"moduleRefs": { "index": 14, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
- "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
- "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
+ "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. Seri [...]
+ "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. S [...]
"allowUnmarshallType": { "index": 17, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used." },
"timezone": { "index": 18, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." },
"schemaResolver": { "index": 19, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
index 75fc05c4d209..41e02a712a7a 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
@@ -8693,8 +8693,10 @@ To use custom Jackson modules referred from the Camel registry. Multiple modules
<xs:documentation xml:lang="en">
<![CDATA[
Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that
-matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated
-by comma.
+matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature,
+JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be
+separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g.
+SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.
]]>
</xs:documentation>
</xs:annotation>
@@ -8704,8 +8706,10 @@ by comma.
<xs:documentation xml:lang="en">
<![CDATA[
Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name
-that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be
-separated by comma.
+that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature,
+JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be
+separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g.
+SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.
]]>
</xs:documentation>
</xs:annotation>
@@ -9073,7 +9077,8 @@ To use custom Jackson modules referred from the Camel registry. Multiple modules
<xs:documentation xml:lang="en">
<![CDATA[
Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated
-by comma.
+by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g.
+SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.
]]>
</xs:documentation>
</xs:annotation>
@@ -9083,7 +9088,8 @@ by comma.
<xs:documentation xml:lang="en">
<![CDATA[
Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be
-separated by comma.
+separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g.
+SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.
]]>
</xs:documentation>
</xs:annotation>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
index 860dd40a84c8..4000d296d0ab 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
@@ -7815,8 +7815,10 @@ To use custom Jackson modules referred from the Camel registry. Multiple modules
<xs:documentation xml:lang="en">
<![CDATA[
Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that
-matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated
-by comma.
+matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature,
+JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be
+separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g.
+SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.
]]>
</xs:documentation>
</xs:annotation>
@@ -7826,8 +7828,10 @@ by comma.
<xs:documentation xml:lang="en">
<![CDATA[
Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name
-that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be
-separated by comma.
+that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature,
+JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be
+separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g.
+SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.
]]>
</xs:documentation>
</xs:annotation>
@@ -8195,7 +8199,8 @@ To use custom Jackson modules referred from the Camel registry. Multiple modules
<xs:documentation xml:lang="en">
<![CDATA[
Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated
-by comma.
+by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g.
+SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.
]]>
</xs:documentation>
</xs:annotation>
@@ -8205,7 +8210,8 @@ by comma.
<xs:documentation xml:lang="en">
<![CDATA[
Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be
-separated by comma.
+separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g.
+SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.
]]>
</xs:documentation>
</xs:annotation>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
index 8e31679beaad..c207e4c41bfe 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
@@ -11857,12 +11857,12 @@
}, {
"name" : "disableFeatures",
"type" : "string",
- "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma.",
+ "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeatu [...]
"title" : "Disable Features"
}, {
"name" : "enableFeatures",
"type" : "string",
- "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma.",
+ "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeatur [...]
"title" : "Enable Features"
}, {
"name" : "enableJaxbAnnotationModule",
@@ -12336,7 +12336,7 @@
}, {
"name" : "enableFeatures",
"type" : "string",
- "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.",
+ "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.",
"title" : "Enable Features",
"displayName" : "Enable Features",
"kind" : "attribute",
@@ -12346,7 +12346,7 @@
}, {
"name" : "disableFeatures",
"type" : "string",
- "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.",
+ "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.",
"title" : "Disable Features",
"displayName" : "Disable Features",
"kind" : "attribute",
diff --git a/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json b/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json
index ee25633c82fe..0d7a775bba06 100644
--- a/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json
+++ b/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json
@@ -30,8 +30,8 @@
"useList": { "index": 11, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." },
"moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." },
"moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
- "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
- "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
+ "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. Seri [...]
+ "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. S [...]
"allowUnmarshallType": { "index": 16, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used." },
"timezone": { "index": 17, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." },
"schemaResolver": { "index": 18, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." },
diff --git a/components/camel-jackson3/src/generated/resources/META-INF/org/apache/camel/component/jackson3/jackson.json b/components/camel-jackson3/src/generated/resources/META-INF/org/apache/camel/component/jackson3/jackson.json
index 3e9057ed3dc2..e2d3037bb7ea 100644
--- a/components/camel-jackson3/src/generated/resources/META-INF/org/apache/camel/component/jackson3/jackson.json
+++ b/components/camel-jackson3/src/generated/resources/META-INF/org/apache/camel/component/jackson3/jackson.json
@@ -30,8 +30,8 @@
"useList": { "index": 11, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." },
"moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." },
"moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
- "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
- "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
+ "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. Seri [...]
+ "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. S [...]
"allowUnmarshallType": { "index": 16, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used." },
"timezone": { "index": 17, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." },
"schemaResolver": { "index": 18, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." },
diff --git a/components/camel-jackson3/src/main/java/org/apache/camel/component/jackson3/AbstractJacksonDataFormat.java b/components/camel-jackson3/src/main/java/org/apache/camel/component/jackson3/AbstractJacksonDataFormat.java
index e726d00c91a8..3735892fee59 100644
--- a/components/camel-jackson3/src/main/java/org/apache/camel/component/jackson3/AbstractJacksonDataFormat.java
+++ b/components/camel-jackson3/src/main/java/org/apache/camel/component/jackson3/AbstractJacksonDataFormat.java
@@ -417,7 +417,7 @@ public abstract class AbstractJacksonDataFormat extends ServiceSupport
* Allows jackson to use the <tt>JMSType</tt> header as an indicator what the classname is for unmarshaling content
* to POJO
* <p/>
- * By default this option is <tt>false</tt>.
+ * By default, this option is <tt>false</tt>.
*/
public void setAllowJmsType(boolean allowJmsType) {
this.allowJmsType = allowJmsType;
@@ -541,97 +541,97 @@ public abstract class AbstractJacksonDataFormat extends ServiceSupport
public void enableFeature(SerializationFeature feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void enableFeature(DeserializationFeature feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void enableFeature(MapperFeature feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void enableFeature(Enum<? extends DatatypeFeature> feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void enableFeature(StreamReadFeature feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void enableFeature(StreamWriteFeature feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(SerializationFeature feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(DeserializationFeature feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(MapperFeature feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(Enum<? extends DatatypeFeature> feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(StreamReadFeature feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(StreamWriteFeature feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
@@ -675,7 +675,7 @@ public abstract class AbstractJacksonDataFormat extends ServiceSupport
}
if (enableFeatures != null) {
- doEnableFeaures();
+ doEnableFeatures();
}
if (disableFeatures != null) {
doDisableFeatures();
@@ -737,64 +737,181 @@ public abstract class AbstractJacksonDataFormat extends ServiceSupport
return objectMapperFoundRegistry;
}
- private void doEnableFeaures() {
+ private boolean trySetSerializationFeature(String featureValueName, boolean state) {
+ SerializationFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(SerializationFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setObjectMapper(objectMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetDeserializationFeature(String featureValueName, boolean state) {
+ DeserializationFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(DeserializationFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setObjectMapper(objectMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetMapperFeature(String featureValueName, boolean state) {
+ MapperFeature feature = getCamelContext().getTypeConverter().tryConvertTo(MapperFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setObjectMapper(objectMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetDateTimeFeature(String featureValueName, boolean state) {
+ DateTimeFeature feature = getCamelContext().getTypeConverter().tryConvertTo(DateTimeFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setObjectMapper(objectMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetEnumFeature(String featureValueName, boolean state) {
+ EnumFeature feature = getCamelContext().getTypeConverter().tryConvertTo(EnumFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setObjectMapper(objectMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetJsonNodeFeature(String featureValueName, boolean state) {
+ JsonNodeFeature feature = getCamelContext().getTypeConverter().tryConvertTo(JsonNodeFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setObjectMapper(objectMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetStreamReadFeature(String featureValueName, boolean state) {
+ StreamReadFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(StreamReadFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setObjectMapper(objectMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetStreamWriteFeature(String featureValueName, boolean state) {
+ StreamWriteFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(StreamWriteFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setObjectMapper(objectMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private void doEnableFeatures() {
Iterator<?> it = ObjectHelper.createIterator(enableFeatures);
while (it.hasNext()) {
String enable = it.next().toString();
- // it can be different kind
- SerializationFeature sf
- = getCamelContext().getTypeConverter().tryConvertTo(SerializationFeature.class, enable);
- if (sf != null) {
- ObjectMapper om = objectMapper.rebuild().enable(sf).build();
- setObjectMapper(om);
- continue;
- }
- DeserializationFeature df
- = getCamelContext().getTypeConverter().tryConvertTo(DeserializationFeature.class, enable);
- if (df != null) {
- ObjectMapper om = objectMapper.rebuild().enable(df).build();
- setObjectMapper(om);
- continue;
- }
- MapperFeature mf = getCamelContext().getTypeConverter().tryConvertTo(MapperFeature.class, enable);
- if (mf != null) {
- ObjectMapper om = objectMapper.rebuild().enable(mf).build();
- setObjectMapper(om);
- continue;
+ long dotCount = enable.chars().filter(ch -> ch == '.').count();
+ if (dotCount > 1) {
+ throw new IllegalArgumentException("Enable feature: " + enable + " cannot contain more than one '.'");
}
- DateTimeFeature dtf = getCamelContext().getTypeConverter().tryConvertTo(DateTimeFeature.class, enable);
- if (dtf != null) {
- ObjectMapper om = objectMapper.rebuild().enable(dtf).build();
- setObjectMapper(om);
- continue;
+
+ String featureClassName = null;
+ String featureValueName = enable;
+
+ if (dotCount == 1) {
+ String[] parts = enable.split("\\.", 2);
+ featureClassName = parts[0];
+ featureValueName = parts[1];
}
- EnumFeature ef = getCamelContext().getTypeConverter().tryConvertTo(EnumFeature.class, enable);
- if (ef != null) {
- ObjectMapper om = objectMapper.rebuild().enable(ef).build();
- setObjectMapper(om);
- continue;
+
+ if (featureClassName != null) {
+ if (!switch (featureClassName) {
+ case "SerializationFeature" -> trySetSerializationFeature(featureValueName, true);
+ case "DeserializationFeature" -> trySetDeserializationFeature(featureValueName, true);
+ case "MapperFeature" -> trySetMapperFeature(featureValueName, true);
+ case "DateTimeFeature" -> trySetDateTimeFeature(featureValueName, true);
+ case "EnumFeature" -> trySetEnumFeature(featureValueName, true);
+ case "JsonNodeFeature" -> trySetJsonNodeFeature(featureValueName, true);
+ case "StreamReadFeature" -> trySetStreamReadFeature(featureValueName, true);
+ case "StreamWriteFeature" -> trySetStreamWriteFeature(featureValueName, true);
+ default -> false;
+ }) {
+ throw new IllegalArgumentException(
+ "Enable feature: " + enable
+ + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature]");
+ }
+ } else {
+ if (!trySetSerializationFeature(featureValueName, true)
+ && !trySetDeserializationFeature(featureValueName, true)
+ && !trySetMapperFeature(featureValueName, true)
+ && !trySetDateTimeFeature(featureValueName, true)
+ && !trySetEnumFeature(featureValueName, true)
+ && !trySetJsonNodeFeature(featureValueName, true)
+ && !trySetStreamReadFeature(featureValueName, true)
+ && !trySetStreamWriteFeature(featureValueName, true)) {
+ throw new IllegalArgumentException(
+ "Enable feature: " + featureValueName
+ + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature]");
+ }
}
- JsonNodeFeature jnf = getCamelContext().getTypeConverter().tryConvertTo(JsonNodeFeature.class, enable);
- if (jnf != null) {
- ObjectMapper om = objectMapper.rebuild().enable(jnf).build();
- setObjectMapper(om);
- continue;
+ }
+ }
+
+ private void doDisableFeatures() {
+ Iterator<?> it = ObjectHelper.createIterator(disableFeatures);
+ while (it.hasNext()) {
+ String disable = it.next().toString();
+ long dotCount = disable.chars().filter(ch -> ch == '.').count();
+ if (dotCount > 1) {
+ throw new IllegalArgumentException("Disable feature: " + disable + " cannot contain more than one '.'");
}
- StreamReadFeature srf = getCamelContext().getTypeConverter().tryConvertTo(StreamReadFeature.class, enable);
- if (srf != null) {
- ObjectMapper om = objectMapper.rebuild().enable(srf).build();
- setObjectMapper(om);
- continue;
+
+ String featureClassName = null;
+ String featureValueName = disable;
+
+ if (dotCount == 1) {
+ String[] parts = disable.split("\\.", 2);
+ featureClassName = parts[0];
+ featureValueName = parts[1];
}
- StreamWriteFeature swf = getCamelContext().getTypeConverter().tryConvertTo(StreamWriteFeature.class, enable);
- if (swf != null) {
- ObjectMapper om = objectMapper.rebuild().enable(swf).build();
- setObjectMapper(om);
- continue;
+
+ if (featureClassName != null) {
+ if (!switch (featureClassName) {
+ case "SerializationFeature" -> trySetSerializationFeature(featureValueName, false);
+ case "DeserializationFeature" -> trySetDeserializationFeature(featureValueName, false);
+ case "MapperFeature" -> trySetMapperFeature(featureValueName, false);
+ case "DateTimeFeature" -> trySetDateTimeFeature(featureValueName, false);
+ case "EnumFeature" -> trySetEnumFeature(featureValueName, false);
+ case "JsonNodeFeature" -> trySetJsonNodeFeature(featureValueName, false);
+ case "StreamReadFeature" -> trySetStreamReadFeature(featureValueName, false);
+ case "StreamWriteFeature" -> trySetStreamWriteFeature(featureValueName, false);
+ default -> false;
+ }) {
+ throw new IllegalArgumentException(
+ "Disable feature: " + disable
+ + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature]");
+ }
+ } else {
+ if (!trySetSerializationFeature(featureValueName, false)
+ && !trySetDeserializationFeature(featureValueName, false)
+ && !trySetMapperFeature(featureValueName, false)
+ && !trySetDateTimeFeature(featureValueName, false)
+ && !trySetEnumFeature(featureValueName, false)
+ && !trySetJsonNodeFeature(featureValueName, false)
+ && !trySetStreamReadFeature(featureValueName, false)
+ && !trySetStreamWriteFeature(featureValueName, false)) {
+ throw new IllegalArgumentException(
+ "Disable feature: " + featureValueName
+ + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature]");
+ }
}
- throw new IllegalArgumentException(
- "Enable feature: " + enable
- + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature]");
}
}
@@ -868,67 +985,6 @@ public abstract class AbstractJacksonDataFormat extends ServiceSupport
}
}
- private void doDisableFeatures() {
- Iterator<?> it = ObjectHelper.createIterator(disableFeatures);
- while (it.hasNext()) {
- String disable = it.next().toString();
- // it can be different kind
- SerializationFeature sf
- = getCamelContext().getTypeConverter().tryConvertTo(SerializationFeature.class, disable);
- if (sf != null) {
- ObjectMapper om = objectMapper.rebuild().disable(sf).build();
- setObjectMapper(om);
- continue;
- }
- DeserializationFeature df
- = getCamelContext().getTypeConverter().tryConvertTo(DeserializationFeature.class, disable);
- if (df != null) {
- ObjectMapper om = objectMapper.rebuild().disable(df).build();
- setObjectMapper(om);
- continue;
- }
- MapperFeature mf = getCamelContext().getTypeConverter().tryConvertTo(MapperFeature.class, disable);
- if (mf != null) {
- ObjectMapper om = objectMapper.rebuild().disable(mf).build();
- setObjectMapper(om);
- continue;
- }
- DateTimeFeature dtf = getCamelContext().getTypeConverter().tryConvertTo(DateTimeFeature.class, disable);
- if (dtf != null) {
- ObjectMapper om = objectMapper.rebuild().disable(dtf).build();
- setObjectMapper(om);
- continue;
- }
- EnumFeature ef = getCamelContext().getTypeConverter().tryConvertTo(EnumFeature.class, disable);
- if (ef != null) {
- ObjectMapper om = objectMapper.rebuild().disable(ef).build();
- setObjectMapper(om);
- continue;
- }
- JsonNodeFeature jnf = getCamelContext().getTypeConverter().tryConvertTo(JsonNodeFeature.class, disable);
- if (jnf != null) {
- ObjectMapper om = objectMapper.rebuild().disable(jnf).build();
- setObjectMapper(om);
- continue;
- }
- StreamReadFeature srf = getCamelContext().getTypeConverter().tryConvertTo(StreamReadFeature.class, disable);
- if (srf != null) {
- ObjectMapper om = objectMapper.rebuild().disable(srf).build();
- setObjectMapper(om);
- continue;
- }
- StreamWriteFeature swf = getCamelContext().getTypeConverter().tryConvertTo(StreamWriteFeature.class, disable);
- if (swf != null) {
- ObjectMapper om = objectMapper.rebuild().disable(swf).build();
- setObjectMapper(om);
- continue;
- }
- throw new IllegalArgumentException(
- "Disable feature: " + disable
- + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature]");
- }
- }
-
private PropertyNamingStrategy determineNamingStrategy(String namingStrategy) {
PropertyNamingStrategy strategy = null;
switch (namingStrategy) {
diff --git a/components/camel-jackson3/src/test/java/org/apache/camel/component/jackson3/JacksonFeaturesTest.java b/components/camel-jackson3/src/test/java/org/apache/camel/component/jackson3/JacksonFeaturesTest.java
index 93c6846cc5b2..c35f75ca987e 100644
--- a/components/camel-jackson3/src/test/java/org/apache/camel/component/jackson3/JacksonFeaturesTest.java
+++ b/components/camel-jackson3/src/test/java/org/apache/camel/component/jackson3/JacksonFeaturesTest.java
@@ -23,14 +23,77 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit6.CamelTestSupport;
import org.junit.jupiter.api.Test;
+import tools.jackson.core.StreamReadFeature;
import tools.jackson.core.StreamWriteFeature;
import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.MapperFeature;
import tools.jackson.databind.SerializationFeature;
import tools.jackson.databind.cfg.DateTimeFeature;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class JacksonFeaturesTest extends CamelTestSupport {
+ @Test
+ public void testEnableWrongSyntaxOfFeature() throws Exception {
+ JacksonDataFormat format = new JacksonDataFormat();
+ format.setEnableFeatures("Package.Enum.FEATURE");
+ format.setCamelContext(context());
+ IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, () -> format.doStart());
+ assertEquals("Enable feature: Package.Enum.FEATURE cannot contain more than one '.'", ex.getMessage());
+ }
+
+ @Test
+ public void testEnableWrongTypedFeatureWithClassName() throws Exception {
+ JacksonDataFormat format = new JacksonDataFormat();
+ format.setEnableFeatures("Enum.FEATURE");
+ format.setCamelContext(context());
+ IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, () -> format.doStart());
+ assertEquals(
+ "Enable feature: Enum.FEATURE cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature]",
+ ex.getMessage());
+ }
+
+ @Test
+ public void testEnableWrongTypedFeatureWithoutClassName() throws Exception {
+ JacksonDataFormat format = new JacksonDataFormat();
+ format.setEnableFeatures("FEATURE");
+ format.setCamelContext(context());
+ IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, () -> format.doStart());
+ assertEquals(
+ "Enable feature: FEATURE cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature]",
+ ex.getMessage());
+ }
+
+ @Test
+ public void testEnableStrictDuplicateDetectionFromDifferentFeatures() throws Exception {
+ // Initialization by implementation order (StreamReadFeature before StreamWriteFeature)
+ JacksonDataFormat format1 = new JacksonDataFormat();
+ format1.setEnableFeatures("STRICT_DUPLICATE_DETECTION");
+ format1.setCamelContext(context());
+ format1.doStart();
+ assertTrue(format1.getObjectMapper().isEnabled(StreamReadFeature.STRICT_DUPLICATE_DETECTION));
+ assertFalse(format1.getObjectMapper().isEnabled(StreamWriteFeature.STRICT_DUPLICATE_DETECTION));
+
+ // Explicit declaration of implementing feature set
+ JacksonDataFormat format2 = new JacksonDataFormat();
+ format2.setEnableFeatures("StreamReadFeature.STRICT_DUPLICATE_DETECTION");
+ format2.setCamelContext(context());
+ format2.doStart();
+ assertTrue(format2.getObjectMapper().isEnabled(StreamReadFeature.STRICT_DUPLICATE_DETECTION));
+ assertFalse(format2.getObjectMapper().isEnabled(StreamWriteFeature.STRICT_DUPLICATE_DETECTION));
+
+ JacksonDataFormat format3 = new JacksonDataFormat();
+ format3.setEnableFeatures("StreamWriteFeature.STRICT_DUPLICATE_DETECTION");
+ format3.setCamelContext(context());
+ format3.doStart();
+ assertFalse(format3.getObjectMapper().isEnabled(StreamReadFeature.STRICT_DUPLICATE_DETECTION));
+ assertTrue(format3.getObjectMapper().isEnabled(StreamWriteFeature.STRICT_DUPLICATE_DETECTION));
+ }
+
@Test
public void testEnableDeserializationFeature() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
diff --git a/components/camel-jackson3xml/src/main/java/org/apache/camel/component/jackson3xml/JacksonXMLDataFormat.java b/components/camel-jackson3xml/src/main/java/org/apache/camel/component/jackson3xml/JacksonXMLDataFormat.java
index 9add16f8c058..5f358d160868 100644
--- a/components/camel-jackson3xml/src/main/java/org/apache/camel/component/jackson3xml/JacksonXMLDataFormat.java
+++ b/components/camel-jackson3xml/src/main/java/org/apache/camel/component/jackson3xml/JacksonXMLDataFormat.java
@@ -44,16 +44,23 @@ import org.apache.camel.util.CastUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import tools.jackson.core.StreamReadConstraints;
+import tools.jackson.core.StreamReadFeature;
+import tools.jackson.core.StreamWriteFeature;
import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.JacksonModule;
import tools.jackson.databind.JsonNode;
import tools.jackson.databind.MapperFeature;
import tools.jackson.databind.ObjectReader;
import tools.jackson.databind.SerializationFeature;
+import tools.jackson.databind.cfg.DatatypeFeature;
+import tools.jackson.databind.cfg.DateTimeFeature;
+import tools.jackson.databind.cfg.EnumFeature;
+import tools.jackson.databind.cfg.JsonNodeFeature;
import tools.jackson.databind.type.CollectionType;
import tools.jackson.dataformat.xml.XmlFactory;
import tools.jackson.dataformat.xml.XmlMapper;
import tools.jackson.dataformat.xml.XmlReadFeature;
+import tools.jackson.dataformat.xml.XmlWriteFeature;
import tools.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule;
/**
@@ -132,7 +139,7 @@ public class JacksonXMLDataFormat extends ServiceSupport
}
/**
- * Use a custom Jackson mapper and and unmarshal type
+ * Use a custom Jackson mapper and unmarshal type
*
* @param mapper the custom mapper
* @param unmarshalType the custom unmarshal type
@@ -389,7 +396,7 @@ public class JacksonXMLDataFormat extends ServiceSupport
* Allows jackson to use the <tt>JMSType</tt> header as an indicator what the classname is for unmarshaling XML
* content to POJO
* <p/>
- * By default this option is <tt>false</tt>.
+ * By default, this option is <tt>false</tt>.
*/
public void setAllowJmsType(boolean allowJmsType) {
this.allowJmsType = allowJmsType;
@@ -459,8 +466,10 @@ public class JacksonXMLDataFormat extends ServiceSupport
}
/**
- * Set of features to enable on the Jackson {@link XmlMapper}. The features should be a name that matches a enum
- * from {@link SerializationFeature}, {@link DeserializationFeature}, or {@link MapperFeature}.
+ * Set of features to enable on the Jackson {@link XmlMapper}. The features should be a name that matches an enum
+ * from {@link SerializationFeature}, {@link DeserializationFeature}, {@link MapperFeature},
+ * {@link DateTimeFeature}, {@link EnumFeature}, {@link JsonNodeFeature}, {@link StreamReadFeature},
+ * {@link StreamWriteFeature}, {@link XmlReadFeature} or {@link XmlWriteFeature}.
*/
public void setEnableFeatures(String enableFeatures) {
this.enableFeatures = enableFeatures;
@@ -471,8 +480,10 @@ public class JacksonXMLDataFormat extends ServiceSupport
}
/**
- * Set of features to disable on the Jackson {@link XmlMapper}. The features should be a name that matches a enum
- * from {@link SerializationFeature}, {@link DeserializationFeature}, or {@link MapperFeature}.
+ * Set of features to disable on the Jackson {@link XmlMapper}. The features should be a name that matches an enum
+ * from {@link SerializationFeature}, {@link DeserializationFeature}, {@link MapperFeature},
+ * {@link DateTimeFeature}, {@link EnumFeature}, {@link JsonNodeFeature}, {@link StreamReadFeature},
+ * {@link StreamWriteFeature}, {@link XmlReadFeature} or {@link XmlWriteFeature}.
*/
public void setDisableFeatures(String disableFeatures) {
this.disableFeatures = disableFeatures;
@@ -480,65 +491,129 @@ public class JacksonXMLDataFormat extends ServiceSupport
public void enableFeature(SerializationFeature feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void enableFeature(DeserializationFeature feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void enableFeature(MapperFeature feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ }
+ }
+
+ public void enableFeature(Enum<? extends DatatypeFeature> feature) {
+ if (enableFeatures == null) {
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ } else {
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ }
+ }
+
+ public void enableFeature(StreamReadFeature feature) {
+ if (enableFeatures == null) {
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ } else {
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ }
+ }
+
+ public void enableFeature(StreamWriteFeature feature) {
+ if (enableFeatures == null) {
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ } else {
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void enableFeature(XmlReadFeature feature) {
if (enableFeatures == null) {
- enableFeatures = feature.name();
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- enableFeatures += "," + feature.name();
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ }
+ }
+
+ public void enableFeature(XmlWriteFeature feature) {
+ if (enableFeatures == null) {
+ enableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ } else {
+ enableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(SerializationFeature feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(DeserializationFeature feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(MapperFeature feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ } else {
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ }
+ }
+
+ public void disableFeature(Enum<? extends DatatypeFeature> feature) {
+ if (disableFeatures == null) {
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ } else {
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ }
+ }
+
+ public void disableFeature(StreamReadFeature feature) {
+ if (disableFeatures == null) {
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ }
+ }
+
+ public void disableFeature(StreamWriteFeature feature) {
+ if (disableFeatures == null) {
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ } else {
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
public void disableFeature(XmlReadFeature feature) {
if (disableFeatures == null) {
- disableFeatures = feature.name();
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
} else {
- disableFeatures += "," + feature.name();
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ }
+ }
+
+ public void disableFeature(XmlWriteFeature feature) {
+ if (disableFeatures == null) {
+ disableFeatures = feature.getDeclaringClass().getSimpleName() + "." + feature.name();
+ } else {
+ disableFeatures += "," + feature.getDeclaringClass().getSimpleName() + "." + feature.name();
}
}
@@ -595,105 +670,268 @@ public class JacksonXMLDataFormat extends ServiceSupport
}
if (enableFeatures != null) {
- Iterator<?> it = ObjectHelper.createIterator(enableFeatures);
- while (it.hasNext()) {
- String enable = it.next().toString();
- // it can be different kind
- SerializationFeature sf = getCamelContext().getTypeConverter().tryConvertTo(SerializationFeature.class, enable);
- if (sf != null) {
- xmlMapper = xmlMapper.rebuild().enable(sf).build();
- continue;
- }
- DeserializationFeature df
- = getCamelContext().getTypeConverter().tryConvertTo(DeserializationFeature.class, enable);
- if (df != null) {
- xmlMapper = xmlMapper.rebuild().enable(df).build();
- continue;
- }
- MapperFeature mf = getCamelContext().getTypeConverter().tryConvertTo(MapperFeature.class, enable);
- if (mf != null) {
- xmlMapper = xmlMapper.rebuild().enable(mf).build();
- continue;
- }
- XmlReadFeature pf
- = getCamelContext().getTypeConverter().tryConvertTo(XmlReadFeature.class, enable);
- if (pf != null) {
- xmlMapper = xmlMapper.rebuild().enable(pf).build();
- continue;
- }
- throw new IllegalArgumentException(
- "Enable feature: " + enable
- + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,FromXmlParser.Feature]");
- }
+ doEnableFeatures();
}
if (disableFeatures != null) {
- Iterator<?> it = ObjectHelper.createIterator(disableFeatures);
- while (it.hasNext()) {
- String disable = it.next().toString();
- // it can be different kind
- SerializationFeature sf
- = getCamelContext().getTypeConverter().tryConvertTo(SerializationFeature.class, disable);
- if (sf != null) {
- xmlMapper = xmlMapper.rebuild().disable(sf).build();
- continue;
- }
- DeserializationFeature df
- = getCamelContext().getTypeConverter().tryConvertTo(DeserializationFeature.class, disable);
- if (df != null) {
- xmlMapper = xmlMapper.rebuild().disable(df).build();
- continue;
- }
- MapperFeature mf = getCamelContext().getTypeConverter().tryConvertTo(MapperFeature.class, disable);
- if (mf != null) {
- xmlMapper = xmlMapper.rebuild().disable(mf).build();
- continue;
- }
- XmlReadFeature pf
- = getCamelContext().getTypeConverter().tryConvertTo(XmlReadFeature.class, disable);
- if (pf != null) {
- xmlMapper = xmlMapper.rebuild().disable(pf).build();
- continue;
- }
- throw new IllegalArgumentException(
- "Disable feature: " + disable
- + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,FromXmlParser.Feature]");
- }
+ doDisableFeatures();
}
if (modules != null) {
- for (JacksonModule module : modules) {
- LOG.info("Registering module: {}", module);
- xmlMapper = xmlMapper.rebuild().addModule(module).build();
- }
+ registerModules();
}
if (moduleClassNames != null) {
- Iterable<?> it = ObjectHelper.createIterable(moduleClassNames);
- for (Object o : it) {
- String name = o.toString();
- Class<JacksonModule> clazz = camelContext.getClassResolver().resolveMandatoryClass(name, JacksonModule.class);
- JacksonModule module = camelContext.getInjector().newInstance(clazz);
- LOG.info("Registering module: {} -> {}", name, module);
- xmlMapper = xmlMapper.rebuild().addModule(module).build();
- }
+ registerModulesByClassNames();
}
if (moduleRefs != null) {
- Iterable<?> it = ObjectHelper.createIterable(moduleRefs);
- for (Object o : it) {
- String name = o.toString();
- if (name.startsWith("#")) {
- name = name.substring(1);
+ registerModulesByRefs();
+ }
+ if (org.apache.camel.util.ObjectHelper.isNotEmpty(timezone)) {
+ setTimezone();
+ }
+ }
+
+ private boolean trySetSerializationFeature(String featureValueName, boolean state) {
+ SerializationFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(SerializationFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetDeserializationFeature(String featureValueName, boolean state) {
+ DeserializationFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(DeserializationFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetMapperFeature(String featureValueName, boolean state) {
+ MapperFeature feature = getCamelContext().getTypeConverter().tryConvertTo(MapperFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetDateTimeFeature(String featureValueName, boolean state) {
+ DateTimeFeature feature = getCamelContext().getTypeConverter().tryConvertTo(DateTimeFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetEnumFeature(String featureValueName, boolean state) {
+ EnumFeature feature = getCamelContext().getTypeConverter().tryConvertTo(EnumFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetJsonNodeFeature(String featureValueName, boolean state) {
+ JsonNodeFeature feature = getCamelContext().getTypeConverter().tryConvertTo(JsonNodeFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetStreamReadFeature(String featureValueName, boolean state) {
+ StreamReadFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(StreamReadFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetStreamWriteFeature(String featureValueName, boolean state) {
+ StreamWriteFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(StreamWriteFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetXmlReadFeature(String featureValueName, boolean state) {
+ XmlReadFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(XmlReadFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private boolean trySetXmlWriteFeature(String featureValueName, boolean state) {
+ XmlWriteFeature feature
+ = getCamelContext().getTypeConverter().tryConvertTo(XmlWriteFeature.class, featureValueName);
+ if (feature == null) {
+ return false;
+ }
+ setXmlMapper(xmlMapper.rebuild().configure(feature, state).build());
+ return true;
+ }
+
+ private void doEnableFeatures() {
+ Iterator<?> it = ObjectHelper.createIterator(enableFeatures);
+ while (it.hasNext()) {
+ String enable = it.next().toString();
+ long dotCount = enable.chars().filter(ch -> ch == '.').count();
+ if (dotCount > 1) {
+ throw new IllegalArgumentException("Enable feature: " + enable + " cannot contain more than one '.'");
+ }
+
+ String featureClassName = null;
+ String featureValueName = enable;
+
+ if (dotCount == 1) {
+ String[] parts = enable.split("\\.", 2);
+ featureClassName = parts[0];
+ featureValueName = parts[1];
+ }
+
+ if (featureClassName != null) {
+ if (!switch (featureClassName) {
+ case "SerializationFeature" -> trySetSerializationFeature(featureValueName, true);
+ case "DeserializationFeature" -> trySetDeserializationFeature(featureValueName, true);
+ case "MapperFeature" -> trySetMapperFeature(featureValueName, true);
+ case "DateTimeFeature" -> trySetDateTimeFeature(featureValueName, true);
+ case "EnumFeature" -> trySetEnumFeature(featureValueName, true);
+ case "JsonNodeFeature" -> trySetJsonNodeFeature(featureValueName, true);
+ case "StreamReadFeature" -> trySetStreamReadFeature(featureValueName, true);
+ case "StreamWriteFeature" -> trySetStreamWriteFeature(featureValueName, true);
+ case "XmlReadFeature" -> trySetXmlReadFeature(featureValueName, true);
+ case "XmlWriteFeature" -> trySetXmlWriteFeature(featureValueName, true);
+ default -> false;
+ }) {
+ throw new IllegalArgumentException(
+ "Enable feature: " + enable
+ + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature,XmlReadFeature,XmlWriteFeature]");
+ }
+ } else {
+ if (!trySetSerializationFeature(featureValueName, true)
+ && !trySetDeserializationFeature(featureValueName, true)
+ && !trySetMapperFeature(featureValueName, true)
+ && !trySetDateTimeFeature(featureValueName, true)
+ && !trySetEnumFeature(featureValueName, true)
+ && !trySetJsonNodeFeature(featureValueName, true)
+ && !trySetStreamReadFeature(featureValueName, true)
+ && !trySetStreamWriteFeature(featureValueName, true)
+ && !trySetXmlReadFeature(featureValueName, true)
+ && !trySetXmlWriteFeature(featureValueName, true)) {
+ throw new IllegalArgumentException(
+ "Enable feature: " + featureValueName
+ + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature,XmlReadFeature,XmlWriteFeature]");
}
- JacksonModule module = CamelContextHelper.mandatoryLookup(camelContext, name, JacksonModule.class);
- LOG.info("Registering module: {} -> {}", name, module);
- xmlMapper = xmlMapper.rebuild().addModule(module).build();
}
}
- if (org.apache.camel.util.ObjectHelper.isNotEmpty(timezone)) {
- LOG.debug("Setting timezone to XML Mapper: {}", timezone);
- xmlMapper = xmlMapper.rebuild().defaultTimeZone(timezone).build();
+ }
+
+ private void doDisableFeatures() {
+ Iterator<?> it = ObjectHelper.createIterator(disableFeatures);
+ while (it.hasNext()) {
+ String disable = it.next().toString();
+ long dotCount = disable.chars().filter(ch -> ch == '.').count();
+ if (dotCount > 1) {
+ throw new IllegalArgumentException("Disable feature: " + disable + " cannot contain more than one '.'");
+ }
+
+ String featureClassName = null;
+ String featureValueName = disable;
+
+ if (dotCount == 1) {
+ String[] parts = disable.split("\\.", 2);
+ featureClassName = parts[0];
+ featureValueName = parts[1];
+ }
+
+ if (featureClassName != null) {
+ if (!switch (featureClassName) {
+ case "SerializationFeature" -> trySetSerializationFeature(featureValueName, false);
+ case "DeserializationFeature" -> trySetDeserializationFeature(featureValueName, false);
+ case "MapperFeature" -> trySetMapperFeature(featureValueName, false);
+ case "DateTimeFeature" -> trySetDateTimeFeature(featureValueName, false);
+ case "EnumFeature" -> trySetEnumFeature(featureValueName, false);
+ case "JsonNodeFeature" -> trySetJsonNodeFeature(featureValueName, false);
+ case "StreamReadFeature" -> trySetStreamReadFeature(featureValueName, false);
+ case "StreamWriteFeature" -> trySetStreamWriteFeature(featureValueName, false);
+ case "XmlReadFeature" -> trySetXmlReadFeature(featureValueName, false);
+ case "XmlWriteFeature" -> trySetXmlWriteFeature(featureValueName, false);
+ default -> false;
+ }) {
+ throw new IllegalArgumentException(
+ "Disable feature: " + disable
+ + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature,XmlReadFeature,XmlWriteFeature]");
+ }
+ } else {
+ if (!trySetSerializationFeature(featureValueName, false)
+ && !trySetDeserializationFeature(featureValueName, false)
+ && !trySetMapperFeature(featureValueName, false)
+ && !trySetDateTimeFeature(featureValueName, false)
+ && !trySetEnumFeature(featureValueName, false)
+ && !trySetJsonNodeFeature(featureValueName, false)
+ && !trySetStreamReadFeature(featureValueName, false)
+ && !trySetStreamWriteFeature(featureValueName, false)
+ && !trySetXmlReadFeature(featureValueName, false)
+ && !trySetXmlWriteFeature(featureValueName, false)) {
+ throw new IllegalArgumentException(
+ "Disable feature: " + featureValueName
+ + " cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature,XmlReadFeature,XmlWriteFeature]");
+ }
+ }
+ }
+ }
+
+ private void registerModules() {
+ for (JacksonModule module : modules) {
+ LOG.info("Registering module: {}", module);
+ xmlMapper = xmlMapper.rebuild().addModule(module).build();
+ }
+ }
+
+ private void registerModulesByClassNames() throws ClassNotFoundException {
+ Iterable<?> it = ObjectHelper.createIterable(moduleClassNames);
+ for (Object o : it) {
+ String name = o.toString();
+ Class<JacksonModule> clazz = camelContext.getClassResolver().resolveMandatoryClass(name, JacksonModule.class);
+ JacksonModule module = camelContext.getInjector().newInstance(clazz);
+ LOG.info("Registering module: {} -> {}", name, module);
+ xmlMapper = xmlMapper.rebuild().addModule(module).build();
}
}
+ private void registerModulesByRefs() {
+ Iterable<?> it = ObjectHelper.createIterable(moduleRefs);
+ for (Object o : it) {
+ String name = o.toString();
+ if (name.startsWith("#")) {
+ name = name.substring(1);
+ }
+ JacksonModule module = CamelContextHelper.mandatoryLookup(camelContext, name, JacksonModule.class);
+ LOG.info("Registering module: {} -> {}", name, module);
+ xmlMapper = xmlMapper.rebuild().addModule(module).build();
+ }
+ }
+
+ private void setTimezone() {
+ LOG.debug("Setting timezone to XML Mapper: {}", timezone);
+ xmlMapper = xmlMapper.rebuild().defaultTimeZone(timezone).build();
+ }
+
@Override
protected void doStop() throws Exception {
// noop
diff --git a/components/camel-jackson3xml/src/main/java/org/apache/camel/component/jackson3xml/ListJacksonXMLDataFormat.java b/components/camel-jackson3xml/src/main/java/org/apache/camel/component/jackson3xml/ListJacksonXMLDataFormat.java
index 30284da268eb..6d900ea2ca02 100644
--- a/components/camel-jackson3xml/src/main/java/org/apache/camel/component/jackson3xml/ListJacksonXMLDataFormat.java
+++ b/components/camel-jackson3xml/src/main/java/org/apache/camel/component/jackson3xml/ListJacksonXMLDataFormat.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.jackson3xml;
import tools.jackson.dataformat.xml.XmlMapper;
/**
- * A {@link org.apache.camel.component.jacksonxml.JacksonXMLDataFormat} that is using a list
+ * A {@link org.apache.camel.component.jackson3xml.JacksonXMLDataFormat} that is using a list
*/
public class ListJacksonXMLDataFormat extends JacksonXMLDataFormat {
diff --git a/components/camel-jackson3xml/src/test/java/org/apache/camel/component/jackson3xml/JacksonFeaturesTest.java b/components/camel-jackson3xml/src/test/java/org/apache/camel/component/jackson3xml/JacksonFeaturesTest.java
new file mode 100644
index 000000000000..6e6ae99f83aa
--- /dev/null
+++ b/components/camel-jackson3xml/src/test/java/org/apache/camel/component/jackson3xml/JacksonFeaturesTest.java
@@ -0,0 +1,117 @@
+/*
+ * 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.jackson3xml;
+
+import java.util.Arrays;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import tools.jackson.core.StreamReadFeature;
+import tools.jackson.core.StreamWriteFeature;
+import tools.jackson.dataformat.xml.XmlWriteFeature;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class JacksonFeaturesTest extends CamelTestSupport {
+
+ @Test
+ public void testEnableWrongSyntaxOfFeature() throws Exception {
+ JacksonXMLDataFormat format = new JacksonXMLDataFormat();
+ format.setEnableFeatures("Package.Enum.FEATURE");
+ format.setCamelContext(context());
+ IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, () -> format.doStart());
+ assertEquals("Enable feature: Package.Enum.FEATURE cannot contain more than one '.'", ex.getMessage());
+ }
+
+ @Test
+ public void testEnableWrongTypedFeatureWithClassName() throws Exception {
+ JacksonXMLDataFormat format = new JacksonXMLDataFormat();
+ format.setEnableFeatures("Enum.FEATURE");
+ format.setCamelContext(context());
+ IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, () -> format.doStart());
+ assertEquals(
+ "Enable feature: Enum.FEATURE cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature,XmlReadFeature,XmlWriteFeature]",
+ ex.getMessage());
+ }
+
+ @Test
+ public void testEnableWrongTypedFeatureWithoutClassName() throws Exception {
+ JacksonXMLDataFormat format = new JacksonXMLDataFormat();
+ format.setEnableFeatures("FEATURE");
+ format.setCamelContext(context());
+ IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, () -> format.doStart());
+ assertEquals(
+ "Enable feature: FEATURE cannot be converted to an accepted enum of types [SerializationFeature,DeserializationFeature,MapperFeature,DateTimeFeature,EnumFeature,JsonNodeFeature,StreamReadFeature,StreamWriteFeature,XmlReadFeature,XmlWriteFeature]",
+ ex.getMessage());
+ }
+
+ @Test
+ public void testEnableStrictDuplicateDetectionFromDifferentFeatures() throws Exception {
+ // Initialization by implementation order (StreamReadFeature before StreamWriteFeature)
+ JacksonXMLDataFormat format1 = new JacksonXMLDataFormat();
+ format1.setEnableFeatures("STRICT_DUPLICATE_DETECTION");
+ format1.setCamelContext(context());
+ format1.doStart();
+ assertTrue(format1.getXmlMapper().isEnabled(StreamReadFeature.STRICT_DUPLICATE_DETECTION));
+ assertFalse(format1.getXmlMapper().isEnabled(StreamWriteFeature.STRICT_DUPLICATE_DETECTION));
+
+ // Explicit declaration of implementing feature set
+ JacksonXMLDataFormat format2 = new JacksonXMLDataFormat();
+ format2.setEnableFeatures("StreamReadFeature.STRICT_DUPLICATE_DETECTION");
+ format2.setCamelContext(context());
+ format2.doStart();
+ assertTrue(format2.getXmlMapper().isEnabled(StreamReadFeature.STRICT_DUPLICATE_DETECTION));
+ assertFalse(format2.getXmlMapper().isEnabled(StreamWriteFeature.STRICT_DUPLICATE_DETECTION));
+
+ JacksonXMLDataFormat format3 = new JacksonXMLDataFormat();
+ format3.setEnableFeatures("StreamWriteFeature.STRICT_DUPLICATE_DETECTION");
+ format3.setCamelContext(context());
+ format3.doStart();
+ assertFalse(format3.getXmlMapper().isEnabled(StreamReadFeature.STRICT_DUPLICATE_DETECTION));
+ assertTrue(format3.getXmlMapper().isEnabled(StreamWriteFeature.STRICT_DUPLICATE_DETECTION));
+ }
+
+ @Test
+ public void testEnableMapperFeature() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMessageCount(1);
+ mock.message(0).body(String.class).isEqualTo("<ArrayList><item>test</item><item/></ArrayList>");
+
+ template.send("direct:format", exchange -> exchange.getIn().setBody(Arrays.asList("test", null)));
+
+ mock.assertIsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+
+ @Override
+ public void configure() {
+ JacksonXMLDataFormat formatModel = new JacksonXMLDataFormat();
+ formatModel.disableFeature(XmlWriteFeature.WRITE_NULLS_AS_XSI_NIL);
+
+ from("direct:format").marshal(formatModel).to("mock:result");
+ }
+ };
+ }
+}
diff --git a/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json b/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json
index fde717538389..a664df243048 100644
--- a/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json
+++ b/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json
@@ -30,8 +30,8 @@
"enableJaxbAnnotationModule": { "index": 11, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using Jackson. When enabled then JAXB annotations can be used by Jackson." },
"moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." },
"moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
- "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separate [...]
- "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separ [...]
+ "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNo [...]
+ "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, Jso [...]
"contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
"maxStringLength": { "index": 17, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum allowed string length when deserializing (in chars or bytes, depending on input context). The default is 20,000,000." }
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json
index 9d1ee0e2e9ca..ae60295e87f8 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json
@@ -27,8 +27,8 @@
"enableJaxbAnnotationModule": { "index": 11, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using Jackson. When enabled then JAXB annotations can be used by Jackson." },
"moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." },
"moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
- "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separate [...]
- "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separ [...]
+ "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNo [...]
+ "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, Jso [...]
"contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
"maxStringLength": { "index": 17, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum allowed string length when deserializing (in chars or bytes, depending on input context). The default is 20,000,000." }
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json
index f42ba35001f4..ebabe678aede 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json
@@ -27,8 +27,8 @@
"useList": { "index": 12, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." },
"moduleClassNames": { "index": 13, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." },
"moduleRefs": { "index": 14, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
- "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
- "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma." },
+ "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. Seri [...]
+ "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. S [...]
"allowUnmarshallType": { "index": 17, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used." },
"timezone": { "index": 18, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." },
"schemaResolver": { "index": 19, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." },
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java
index 316eab9bfb33..8e8b74ac5419 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java
@@ -95,13 +95,15 @@ public class JacksonXMLDataFormat extends DataFormatDefinition implements Conten
private String moduleRefs;
@XmlAttribute
@Metadata(description = "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper."
- + " The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature."
- + " Multiple features can be separated by comma.")
+ + " The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature."
+ + " Multiple features can be separated by comma."
+ + " When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.")
private String enableFeatures;
@XmlAttribute
@Metadata(description = "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper."
- + " The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature."
- + " Multiple features can be separated by comma.")
+ + " The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature."
+ + " Multiple features can be separated by comma."
+ + " When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.")
private String disableFeatures;
@XmlAttribute
@Metadata(javaType = "java.lang.Boolean", defaultValue = "true",
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
index addd9ccd0c67..76a92bbb0b45 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
@@ -100,11 +100,13 @@ public class JsonDataFormat extends DataFormatDefinition implements ContentTypeH
private String moduleRefs;
@XmlAttribute
@Metadata(label = "advanced",
- description = "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.")
+ description = "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma."
+ + " When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.")
private String enableFeatures;
@XmlAttribute
@Metadata(label = "advanced",
- description = "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.")
+ description = "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma."
+ + " When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.")
private String disableFeatures;
@XmlAttribute
@Metadata(javaType = "java.lang.Boolean",
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
index 7e49e693e2fc..fdd37d85b275 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
@@ -7403,8 +7403,8 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
@YamlProperty(name = "allowUnmarshallType", type = "boolean", defaultValue = "false", description = "Whether to allow Jackson to use the CamelJacksonUnmarshalType header during unmarshalling. Should only be enabled when desired.", displayName = "Allow Unmarshall Type"),
@YamlProperty(name = "collectionType", type = "string", description = "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default.", displayName = "Collection Type"),
@YamlProperty(name = "contentTypeHeader", type = "boolean", defaultValue = "true", description = "Whether the data format should set the Content-Type header with the type from the data format. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSON", displayName = "Content Type Header"),
- @YamlProperty(name = "disableFeatures", type = "string", description = "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma.", displayName = "Disable Features"),
- @YamlProperty(name = "enableFeatures", type = "string", description = "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma.", displayName = "Enable Features"),
+ @YamlProperty(name = "disableFeatures", type = "string", description = "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature [...]
+ @YamlProperty(name = "enableFeatures", type = "string", description = "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature c [...]
@YamlProperty(name = "enableJaxbAnnotationModule", type = "boolean", defaultValue = "false", description = "Whether to enable the JAXB annotations module when using Jackson. When enabled then JAXB annotations can be used by Jackson.", displayName = "Enable Jaxb Annotation Module"),
@YamlProperty(name = "id", type = "string", description = "The id of this node", displayName = "Id"),
@YamlProperty(name = "include", type = "string", description = "If you want to marshal a POJO to JSON, and the POJO has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL.", displayName = "Include"),
@@ -8148,8 +8148,8 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
@YamlProperty(name = "combineUnicodeSurrogates", type = "boolean", defaultValue = "false", description = "Force generator that outputs JSON content to combine surrogate pairs (if any) into 4-byte characters. This should be preferred when using 4-byte characters such as Japanese.", displayName = "Combine Unicode Surrogates"),
@YamlProperty(name = "contentTypeHeader", type = "boolean", defaultValue = "true", description = "Whether the data format should set the Content-Type header with the type from the data format. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSON", displayName = "Content Type Header"),
@YamlProperty(name = "dateFormatPattern", type = "string", description = "To configure the date format while marshall or unmarshall Date fields in JSON using Gson", displayName = "Date Format Pattern"),
- @YamlProperty(name = "disableFeatures", type = "string", description = "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.", displayName = "Disable Features"),
- @YamlProperty(name = "enableFeatures", type = "string", description = "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.", displayName = "Enable Features"),
+ @YamlProperty(name = "disableFeatures", type = "string", description = "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.", displayName = "Disable Features"),
+ @YamlProperty(name = "enableFeatures", type = "string", description = "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.", displayName = "Enable Features"),
@YamlProperty(name = "id", type = "string", description = "The id of this node", displayName = "Id"),
@YamlProperty(name = "include", type = "string", description = "If you want to marshal a POJO to JSON, and the POJO has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL.", displayName = "Include"),
@YamlProperty(name = "jsonView", type = "string", description = "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations.", displayName = "Json View"),
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
index d695eeef6ea7..935186046598 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
@@ -7510,12 +7510,12 @@
"disableFeatures" : {
"type" : "string",
"title" : "Disable Features",
- "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma."
+ "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationF [...]
},
"enableFeatures" : {
"type" : "string",
"title" : "Enable Features",
- "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma."
+ "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFe [...]
},
"enableJaxbAnnotationModule" : {
"type" : "boolean",
@@ -7784,12 +7784,12 @@
"disableFeatures" : {
"type" : "string",
"title" : "Disable Features",
- "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma."
+ "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name."
},
"enableFeatures" : {
"type" : "string",
"title" : "Enable Features",
- "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma."
+ "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name."
},
"id" : {
"type" : "string",
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
index 8e31679beaad..c207e4c41bfe 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
@@ -11857,12 +11857,12 @@
}, {
"name" : "disableFeatures",
"type" : "string",
- "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma.",
+ "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeatu [...]
"title" : "Disable Features"
}, {
"name" : "enableFeatures",
"type" : "string",
- "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma.",
+ "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeatur [...]
"title" : "Enable Features"
}, {
"name" : "enableJaxbAnnotationModule",
@@ -12336,7 +12336,7 @@
}, {
"name" : "enableFeatures",
"type" : "string",
- "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.",
+ "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.",
"title" : "Enable Features",
"displayName" : "Enable Features",
"kind" : "attribute",
@@ -12346,7 +12346,7 @@
}, {
"name" : "disableFeatures",
"type" : "string",
- "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.",
+ "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name.",
"title" : "Disable Features",
"displayName" : "Disable Features",
"kind" : "attribute",
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
index 713ecdef4a8d..68f4f668be79 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
@@ -10920,12 +10920,12 @@
"disableFeatures" : {
"type" : "string",
"title" : "Disable Features",
- "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma."
+ "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationF [...]
},
"enableFeatures" : {
"type" : "string",
"title" : "Enable Features",
- "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, or MapperFeature. Multiple features can be separated by comma."
+ "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from SerializationFeature, DeserializationFeature, MapperFeature, DateTimeFeature, EnumFeature, JsonNodeFeature, StreamReadFeature, StreamWriteFeature, XmlReadFeature or XmlWriteFeature. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFe [...]
},
"enableJaxbAnnotationModule" : {
"type" : "boolean",
@@ -11194,12 +11194,12 @@
"disableFeatures" : {
"type" : "string",
"title" : "Disable Features",
- "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma."
+ "description" : "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name."
},
"enableFeatures" : {
"type" : "string",
"title" : "Enable Features",
- "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma."
+ "description" : "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma. When using Jackson 3, a feature can be qualified with its enum class name (e.g. SerializationFeature.WRAP_ROOT_VALUE) to tell apart features with the same name."
},
"id" : {
"type" : "string",