Skip to content

Commit

Permalink
Fix upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Mar 2, 2023
1 parent d89efda commit cba807b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@ public final void init() {
if (maxAliases != null) {
loaderOptions.setMaxAliasesForCollections(Integer.parseInt(maxAliases));
}
Representer representer = new Representer();
DumperOptions dumperOptions = new DumperOptions();
dumperOptions.setDefaultFlowStyle(representer.getDefaultFlowStyle());
dumperOptions.setDefaultScalarStyle(representer.getDefaultScalarStyle());
dumperOptions.setAllowReadOnlyProperties(representer.getPropertyUtils().isAllowReadOnlyProperties());
dumperOptions.setTimeZone(representer.getTimeZone());
Representer representer = new Representer(dumperOptions);
this.yaml = new Yaml(constructor, representer, dumperOptions, loaderOptions);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.ConfigurableApplicationContext;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.nodes.Node;
Expand Down Expand Up @@ -34,7 +35,7 @@ public final class MapfishPrintConstructor extends Constructor {
* @param context the application context object for creating
*/
public MapfishPrintConstructor(final ConfigurableApplicationContext context) {
super(new TypeDescription(Configuration.class, CONFIGURATION_TAG));
super(new TypeDescription(Configuration.class, CONFIGURATION_TAG), new LoaderOptions());
this.context = context;
Map<String, ConfigurationObject> yamlObjects = context.getBeansOfType(ConfigurationObject.class);
for (Map.Entry<String, ConfigurationObject> entry: yamlObjects.entrySet()) {
Expand Down

0 comments on commit cba807b

Please sign in to comment.