diff --git a/cli/src/config.rs b/cli/src/config.rs index d8a526b1..af4c3342 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -31,11 +31,11 @@ pub struct ScalaParams { #[serde(default)] pub struct SwiftParams { pub prefix: String, - pub type_mappings: HashMap, pub default_decorators: Vec, pub default_generic_constraints: Vec, /// The contraints to apply to `CodableVoid`. pub codablevoid_constraints: Vec, + pub type_mappings: HashMap, } #[derive(Default, Serialize, Deserialize, PartialEq, Eq, Debug)] @@ -49,8 +49,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 @@ -126,6 +126,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");