mirror of https://github.com/apache/nifi.git
NIFI-11254 Upgraded SnakeYAML from 1.33 to 2.0
- Updated MiNiFi and EasyRules references to use required arguments Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #7084.
This commit is contained in:
parent
b50c8101cf
commit
2698000a85
|
@ -17,11 +17,13 @@
|
|||
|
||||
package org.apache.nifi.minifi.commons.schema.serialization;
|
||||
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.nodes.Tag;
|
||||
import org.yaml.snakeyaml.representer.Representer;
|
||||
|
||||
public class ConfigRepresenter extends Representer {
|
||||
public ConfigRepresenter() {
|
||||
super(new DumperOptions());
|
||||
nullRepresenter = data -> representScalar(Tag.NULL, "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.jeasy.rules.support.reader.JsonRuleDefinitionReader;
|
|||
import org.jeasy.rules.support.RuleDefinition;
|
||||
import org.jeasy.rules.support.reader.RuleDefinitionReader;
|
||||
import org.jeasy.rules.support.reader.YamlRuleDefinitionReader;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.constructor.Constructor;
|
||||
|
||||
|
@ -116,7 +117,7 @@ public class RulesFactory {
|
|||
|
||||
private static List<Rule> yamlToRules(InputStream rulesInputStream) throws FileNotFoundException {
|
||||
List<Rule> rules = new ArrayList<>();
|
||||
Yaml yaml = new Yaml(new Constructor(Rule.class));
|
||||
Yaml yaml = new Yaml(new Constructor(Rule.class, new LoaderOptions()));
|
||||
for (Object object : yaml.loadAll(rulesInputStream)) {
|
||||
if (object instanceof Rule) {
|
||||
rules.add((Rule) object);
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -141,7 +141,7 @@
|
|||
<logback.version>1.3.5</logback.version>
|
||||
<mockito.version>4.11.0</mockito.version>
|
||||
<netty.3.version>3.10.6.Final</netty.3.version>
|
||||
<snakeyaml.version>1.33</snakeyaml.version>
|
||||
<snakeyaml.version>2.0</snakeyaml.version>
|
||||
<netty.4.version>4.1.90.Final</netty.4.version>
|
||||
<spring.version>5.3.26</spring.version>
|
||||
<spring.security.version>5.8.2</spring.security.version>
|
||||
|
|
Loading…
Reference in New Issue