Skip to content

Commit

Permalink
chore(deps): update snakeyaml to 2.0 (#1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp authored Feb 28, 2023
1 parent 5d61dcb commit 972c592
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gapic-generator-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.google.googlejavaformat</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;

Expand Down Expand Up @@ -77,7 +78,7 @@ static Optional<List<GapicBatchingSettings>> parse(String gapicYamlConfigFilePat
return Optional.empty();
}

Yaml yaml = new Yaml(new SafeConstructor());
Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
Map<String, Object> yamlMap = yaml.load(fileContents);
return parseFromMap(yamlMap);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.nio.file.Paths;
import java.util.Map;
import java.util.Optional;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;

Expand Down Expand Up @@ -56,7 +57,7 @@ static Optional<GapicLanguageSettings> parse(String gapicYamlConfigFilePath) {
return Optional.empty();
}

Yaml yaml = new Yaml(new SafeConstructor());
Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
Map<String, Object> yamlMap = yaml.load(fileContents);
return parseFromMap(yamlMap);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;

Expand Down Expand Up @@ -64,7 +65,7 @@ static Optional<List<GapicLroRetrySettings>> parse(String gapicYamlConfigFilePat
return Optional.empty();
}

Yaml yaml = new Yaml(new SafeConstructor());
Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
Map<String, Object> yamlMap = yaml.load(fileContents);
return parseFromMap(yamlMap);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Optional;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;

Expand All @@ -44,7 +45,7 @@ public static Optional<com.google.api.Service> parse(String serviceYamlFilePath)
return Optional.empty();
}

Yaml yaml = new Yaml(new SafeConstructor());
Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
Map<String, Object> yamlMap = yaml.load(fileContents);
Gson gson = new GsonBuilder().setPrettyPrinting().setLenient().create();
String jsonString = gson.toJson(yamlMap, LinkedHashMap.class);
Expand Down

0 comments on commit 972c592

Please sign in to comment.