This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new f11dfaf CAMEL-14532 - Fixing up docs
f11dfaf is described below
commit f11dfaf154dce05b8df6d4d69e0e8a55c1af82c6
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Tue Feb 18 12:48:37 2020 +0000
CAMEL-14532 - Fixing up docs
---
.../snakeyaml/SnakeYAMLDataFormatConfigurer.java | 4 ++++
.../camel/component/snakeyaml/yaml-snakeyaml.json | 2 ++
.../src/main/docs/yaml-snakeyaml-dataformat.adoc | 4 +++-
.../org/apache/camel/model/dataformat/yaml.json | 2 ++
.../camel/model/dataformat/YAMLDataFormat.java | 27 ++++++++++++++++++++++
.../reifier/dataformat/YAMLDataFormatReifier.java | 2 ++
6 files changed, 40 insertions(+), 1 deletion(-)
diff --git
a/components/camel-snakeyaml/src/generated/java/org/apache/camel/component/snakeyaml/SnakeYAMLDataFormatConfigurer.java
b/components/camel-snakeyaml/src/generated/java/org/apache/camel/component/snakeyaml/SnakeYAMLDataFormatConfigurer.java
index ba9d242..026f700 100644
---
a/components/camel-snakeyaml/src/generated/java/org/apache/camel/component/snakeyaml/SnakeYAMLDataFormatConfigurer.java
+++
b/components/camel-snakeyaml/src/generated/java/org/apache/camel/component/snakeyaml/SnakeYAMLDataFormatConfigurer.java
@@ -29,6 +29,10 @@ public class SnakeYAMLDataFormatConfigurer extends
PropertyConfigurerSupport imp
case "prettyFlow": dataformat.setPrettyFlow(property(camelContext,
boolean.class, value)); return true;
case "allowanytype":
case "allowAnyType": dataformat.setAllowAnyType(property(camelContext,
boolean.class, value)); return true;
+ case "maxaliasesforcollections":
+ case "maxAliasesForCollections":
dataformat.setMaxAliasesForCollections(property(camelContext, int.class,
value)); return true;
+ case "allowrecursivekeys":
+ case "allowRecursiveKeys":
dataformat.setAllowRecursiveKeys(property(camelContext, boolean.class, value));
return true;
default: return false;
}
}
diff --git
a/components/camel-snakeyaml/src/generated/resources/org/apache/camel/component/snakeyaml/yaml-snakeyaml.json
b/components/camel-snakeyaml/src/generated/resources/org/apache/camel/component/snakeyaml/yaml-snakeyaml.json
index 0cb2baa..ed61f7d 100644
---
a/components/camel-snakeyaml/src/generated/resources/org/apache/camel/component/snakeyaml/yaml-snakeyaml.json
+++
b/components/camel-snakeyaml/src/generated/resources/org/apache/camel/component/snakeyaml/yaml-snakeyaml.json
@@ -26,6 +26,8 @@
"prettyFlow": { "kind": "attribute", "displayName": "Pretty Flow",
"required": false, "type": "boolean", "javaType": "java.lang.Boolean",
"deprecated": false, "secret": false, "defaultValue": false, "description":
"Force the emitter to produce a pretty YAML document when using the flow
style." },
"allowAnyType": { "kind": "attribute", "displayName": "Allow Any Type",
"required": false, "type": "boolean", "javaType": "java.lang.Boolean",
"deprecated": false, "secret": false, "defaultValue": false, "description":
"Allow any class to be un-marshaled" },
"typeFilter": { "kind": "element", "displayName": "Type Filter",
"required": false, "type": "array", "javaType":
"java.util.List<org.apache.camel.model.dataformat.YAMLTypeFilterDefinition>",
"deprecated": false, "secret": false, "description": "Set the types SnakeYAML
is allowed to un-marshall" },
+ "maxAliasesForCollections": { "kind": "attribute", "displayName": "Max
Aliases For Collections", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "secret": false, "defaultValue":
"50", "description": "Set the maximum amount of aliases allowed for
collections." },
+ "allowRecursiveKeys": { "kind": "attribute", "displayName": "Allow
Recursive Keys", "required": false, "type": "boolean", "javaType":
"java.lang.Boolean", "deprecated": false, "secret": false, "defaultValue":
false, "description": "Set whether recursive keys are allowed." },
"contentTypeHeader": { "kind": "attribute", "displayName": "Content Type
Header", "required": false, "type": "boolean", "javaType": "java.lang.Boolean",
"deprecated": false, "secret": false, "defaultValue": false, "description":
"Whether the data format should set the Content-Type header with the type from
the data format if the data format is capable of doing so. For example
application\/xml for data formats marshalling to XML, or application\/json for
data formats marshalling to JS [...]
"id": { "kind": "attribute", "displayName": "Id", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"secret": false, "description": "The id of this node" }
}
diff --git
a/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc
b/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc
index 3592a7b..65b7964 100644
--- a/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc
+++ b/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc
@@ -18,7 +18,7 @@ SnakeYAML library.
== YAML Options
// dataformat options: START
-The YAML SnakeYAML dataformat supports 11 options, which are listed below.
+The YAML SnakeYAML dataformat supports 13 options, which are listed below.
@@ -35,6 +35,8 @@ The YAML SnakeYAML dataformat supports 11 options, which are
listed below.
| prettyFlow | false | Boolean | Force the emitter to produce a pretty YAML
document when using the flow style.
| allowAnyType | false | Boolean | Allow any class to be un-marshaled
| typeFilter | | List | Set the types SnakeYAML is allowed to un-marshall
+| maxAliasesForCollections | 50 | Integer | Set the maximum amount of aliases
allowed for collections.
+| allowRecursiveKeys | false | Boolean | Set whether recursive keys are
allowed.
| contentTypeHeader | false | Boolean | Whether the data format should set the
Content-Type header with the type from the data format if the data format is
capable of doing so. For example application/xml for data formats marshalling
to XML, or application/json for data formats marshalling to JSon etc.
|===
// dataformat options: END
diff --git
a/core/camel-core-engine/src/generated/resources/org/apache/camel/model/dataformat/yaml.json
b/core/camel-core-engine/src/generated/resources/org/apache/camel/model/dataformat/yaml.json
index f3176ec..ea86cc5 100644
---
a/core/camel-core-engine/src/generated/resources/org/apache/camel/model/dataformat/yaml.json
+++
b/core/camel-core-engine/src/generated/resources/org/apache/camel/model/dataformat/yaml.json
@@ -22,6 +22,8 @@
"prettyFlow": { "kind": "attribute", "displayName": "Pretty Flow",
"required": false, "type": "boolean", "javaType": "java.lang.Boolean",
"deprecated": false, "secret": false, "defaultValue": false, "description":
"Force the emitter to produce a pretty YAML document when using the flow
style." },
"allowAnyType": { "kind": "attribute", "displayName": "Allow Any Type",
"required": false, "type": "boolean", "javaType": "java.lang.Boolean",
"deprecated": false, "secret": false, "defaultValue": false, "description":
"Allow any class to be un-marshaled" },
"typeFilter": { "kind": "element", "displayName": "Type Filter",
"required": false, "type": "array", "javaType":
"java.util.List<org.apache.camel.model.dataformat.YAMLTypeFilterDefinition>",
"deprecated": false, "secret": false, "description": "Set the types SnakeYAML
is allowed to un-marshall" },
+ "maxAliasesForCollections": { "kind": "attribute", "displayName": "Max
Aliases For Collections", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "secret": false, "defaultValue":
"50", "description": "Set the maximum amount of aliases allowed for
collections." },
+ "allowRecursiveKeys": { "kind": "attribute", "displayName": "Allow
Recursive Keys", "required": false, "type": "boolean", "javaType":
"java.lang.Boolean", "deprecated": false, "secret": false, "defaultValue":
false, "description": "Set whether recursive keys are allowed." },
"contentTypeHeader": { "kind": "attribute", "displayName": "Content Type
Header", "required": false, "type": "boolean", "javaType": "java.lang.Boolean",
"deprecated": false, "secret": false, "defaultValue": false, "description":
"Whether the data format should set the Content-Type header with the type from
the data format if the data format is capable of doing so. For example
application\/xml for data formats marshalling to XML, or application\/json for
data formats marshalling to JS [...]
"id": { "kind": "attribute", "displayName": "Id", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"secret": false, "description": "The id of this node" }
}
diff --git
a/core/camel-core-engine/src/main/java/org/apache/camel/model/dataformat/YAMLDataFormat.java
b/core/camel-core-engine/src/main/java/org/apache/camel/model/dataformat/YAMLDataFormat.java
index 7eb2015..0d97b75 100644
---
a/core/camel-core-engine/src/main/java/org/apache/camel/model/dataformat/YAMLDataFormat.java
+++
b/core/camel-core-engine/src/main/java/org/apache/camel/model/dataformat/YAMLDataFormat.java
@@ -63,6 +63,12 @@ public class YAMLDataFormat extends DataFormatDefinition {
private String allowAnyType = Boolean.toString(false);
@XmlElement(name = "typeFilter")
private List<YAMLTypeFilterDefinition> typeFilters;
+ @XmlAttribute
+ @Metadata(javaType = "java.lang.Integer", defaultValue = "50")
+ private int maxAliasesForCollections = 50;
+ @XmlAttribute
+ @Metadata(javaType = "java.lang.Boolean", defaultValue = "false")
+ private boolean allowRecursiveKeys;
public YAMLDataFormat() {
this(YAMLLibrary.SnakeYAML);
@@ -215,4 +221,25 @@ public class YAMLDataFormat extends DataFormatDefinition {
this.typeFilters = typeFilters;
}
+ public int getMaxAliasesForCollections() {
+ return maxAliasesForCollections;
+ }
+
+ /**
+ * Set the maximum amount of aliases allowed for collections.
+ */
+ public void setMaxAliasesForCollections(int maxAliasesForCollections) {
+ this.maxAliasesForCollections = maxAliasesForCollections;
+ }
+
+ public boolean isAllowRecursiveKeys() {
+ return allowRecursiveKeys;
+ }
+
+ /**
+ * Set whether recursive keys are allowed.
+ */
+ public void setAllowRecursiveKeys(boolean allowRecursiveKeys) {
+ this.allowRecursiveKeys = allowRecursiveKeys;
+ }
}
diff --git
a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/YAMLDataFormatReifier.java
b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/YAMLDataFormatReifier.java
index 6f05c17..6f49028 100644
---
a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/YAMLDataFormatReifier.java
+++
b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/YAMLDataFormatReifier.java
@@ -51,6 +51,8 @@ public class YAMLDataFormatReifier extends
DataFormatReifier<YAMLDataFormat> {
properties.put("representer", definition.getRepresenter());
properties.put("dumperOptions", definition.getDumperOptions());
properties.put("resolver", definition.getResolver());
+ properties.put("maxAliasesForCollections",
definition.getMaxAliasesForCollections());
+ properties.put("allowRecursiveKeys",
definition.isAllowRecursiveKeys());
}
private List<String> getTypeFilterDefinitions() {