Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring max aliases for a collection #1375

Merged
merged 8 commits into from
May 24, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.composer.Composer;
import org.yaml.snakeyaml.nodes.MappingNode;
import org.yaml.snakeyaml.nodes.Node;
Expand Down Expand Up @@ -49,7 +50,12 @@ public static Node merge(List<YamlSource> configs) throws ConfiguratorException
}

public static Node read(YamlSource source) throws IOException {
Composer composer = new Composer(new ParserImpl(new StreamReaderWithSource(source)), new Resolver());
LoaderOptions loaderOptions = new LoaderOptions();
loaderOptions.setMaxAliasesForCollections(100);
Composer composer = new Composer(
new ParserImpl(new StreamReaderWithSource(source)),
new Resolver(),
loaderOptions);
return composer.getSingleNode();
}

Expand Down