Skip to content

Commit b0c862d

Browse files
jpraynaudAlenar
authored andcommitted
chore(build-script): replace 'serde_yml' with 'saphyr' dependency
'serde_yml' is unmaintained, archived and has security vulnerabilities.
1 parent 22f438c commit b0c862d

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

Cargo.lock

Lines changed: 33 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/mithril-build-script/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ repository = { workspace = true }
1010
include = ["**/*.rs", "Cargo.toml", "README.md", ".gitignore"]
1111

1212
[dependencies]
13+
saphyr = "0.0.6"
1314
semver = { workspace = true }
1415
serde_json = { workspace = true }
15-
serde_yml = "0.0.12"

internal/mithril-build-script/src/open_api.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
use semver::Version;
21
use std::collections::BTreeMap;
32
use std::fs;
43
use std::path::{Path, PathBuf};
54

5+
use saphyr::{LoadableYamlNode, Yaml};
6+
use semver::Version;
7+
68
type OpenAPIFileName = String;
79
type OpenAPIVersionRaw = String;
810

@@ -29,7 +31,7 @@ pub fn list_all_open_api_spec_files(paths: &[&Path]) -> Vec<PathBuf> {
2931

3032
fn read_version_from_open_api_spec_file<P: AsRef<Path>>(spec_file_path: P) -> OpenAPIVersionRaw {
3133
let yaml_spec = fs::read_to_string(spec_file_path).unwrap();
32-
let open_api: serde_yml::Value = serde_yml::from_str(&yaml_spec).unwrap();
34+
let open_api = &Yaml::load_from_str(&yaml_spec).unwrap()[0];
3335
open_api["info"]["version"].as_str().unwrap().to_owned()
3436
}
3537

0 commit comments

Comments
 (0)