/** * Create the {@link Yaml} instance to use. * <p>The default implementation sets the "allowDuplicateKeys" flag to {@code false}, * enabling built-in duplicate key handling in SnakeYAML 1.18+. * @see LoaderOptions#setAllowDuplicateKeys(boolean) */ protected Yaml createYaml() { LoaderOptions options = new LoaderOptions(); options.setAllowDuplicateKeys(false); return new Yaml(options); }
/** * Create the {@link Yaml} instance to use. * <p>The default implementation sets the "allowDuplicateKeys" flag to {@code false}, * enabling built-in duplicate key handling in SnakeYAML 1.18+. * @see LoaderOptions#setAllowDuplicateKeys(boolean) */ protected Yaml createYaml() { LoaderOptions options = new LoaderOptions(); options.setAllowDuplicateKeys(false); return new Yaml(options); }
@Override protected Yaml createYaml() { BaseConstructor constructor = new OriginTrackingConstructor(); Representer representer = new Representer(); DumperOptions dumperOptions = new DumperOptions(); LimitedResolver resolver = new LimitedResolver(); LoaderOptions loaderOptions = new LoaderOptions(); loaderOptions.setAllowDuplicateKeys(false); return new Yaml(constructor, representer, dumperOptions, loaderOptions, resolver); }
private void createYamlLoader() { LoaderOptions loaderOptions = new LoaderOptions(); loaderOptions.setAllowDuplicateKeys(validationProperties.isAllowDuplicates()); yaml = new Yaml(loaderOptions); }