diff --git a/cli/src/config.rs b/cli/src/config.rs index 88ad9a4e..3b7e8ba8 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -29,9 +29,9 @@ pub struct ScalaParams { #[serde(default)] pub struct SwiftParams { pub prefix: String, - pub type_mappings: HashMap, pub default_decorators: Vec, pub default_generic_constraints: Vec, + pub type_mappings: HashMap, } #[derive(Default, Serialize, Deserialize, PartialEq, Eq, Debug)] @@ -45,8 +45,8 @@ pub struct TypeScriptParams { #[cfg(feature = "go")] pub struct GoParams { pub package: String, - pub type_mappings: HashMap, pub uppercase_acronyms: Vec, + pub type_mappings: HashMap, } /// The paramters that are used to configure the behaviour of typeshare @@ -122,6 +122,14 @@ mod test { [CURRENT_DIR, TEST_DIR, filename].iter().collect() } + #[test] + fn to_string_and_back() { + let path = config_file_path("mappings_config.toml"); + let config = load_config(Some(path)).unwrap(); + + toml::from_str::(&toml::to_string_pretty(&config).unwrap()).unwrap(); + } + #[test] fn default_test() { let path = config_file_path("default_config.toml");