@@ -32,6 +32,8 @@ pub enum VariableTypeDefinition {
3232 MapStringString ( FieldsDefinition < HashMap < String , String > > ) ,
3333 #[ serde( rename = "map[string]file" ) ]
3434 MapStringFile ( FieldsWithPathDefinition < HashMap < String , FilePathWithContent > > ) ,
35+ #[ serde( rename = "map[string]yaml" ) ]
36+ MapStringYaml ( FieldsDefinition < HashMap < String , serde_yaml:: Value > > ) ,
3537 #[ serde( rename = "yaml" ) ]
3638 Yaml ( YamlFieldsDefinition ) ,
3739}
@@ -45,6 +47,7 @@ pub enum VariableType {
4547 File ( FieldsWithPath < FilePathWithContent > ) ,
4648 MapStringString ( Fields < HashMap < String , String > > ) ,
4749 MapStringFile ( FieldsWithPath < HashMap < String , FilePathWithContent > > ) ,
50+ MapStringYaml ( Fields < HashMap < String , serde_yaml:: Value > > ) ,
4851 Yaml ( Fields < serde_yaml:: Value > ) ,
4952}
5053
@@ -62,6 +65,9 @@ impl VariableTypeDefinition {
6265 VariableTypeDefinition :: MapStringFile ( v) => {
6366 VariableType :: MapStringFile ( v. with_config ( constraints) )
6467 }
68+ VariableTypeDefinition :: MapStringYaml ( v) => {
69+ VariableType :: MapStringYaml ( v. with_config ( constraints) )
70+ }
6571 VariableTypeDefinition :: Yaml ( v) => VariableType :: Yaml ( v. with_config ( constraints) ) ,
6672 }
6773 }
@@ -120,6 +126,7 @@ impl VariableType {
120126 VariableType :: File ( f) => f. inner . required ,
121127 VariableType :: MapStringString ( f) => f. required ,
122128 VariableType :: MapStringFile ( f) => f. inner . required ,
129+ VariableType :: MapStringYaml ( f) => f. required ,
123130 VariableType :: Yaml ( f) => f. required ,
124131 }
125132 }
@@ -146,6 +153,7 @@ impl VariableType {
146153 . for_each ( |fp| fp. with_path ( f. file_path . clone ( ) ) ) ;
147154 f. inner . set_final_value ( files)
148155 }
156+ VariableType :: MapStringYaml ( f) => f. set_final_value ( serde_yaml:: from_value ( value) ?) ,
149157 VariableType :: Yaml ( f) => f. set_final_value ( value) ,
150158 } ?;
151159 Ok ( ( ) )
@@ -194,6 +202,12 @@ impl VariableType {
194202 . or ( f. inner . default . as_ref ( ) )
195203 . cloned ( )
196204 . map ( TrivialValue :: MapStringFile ) ,
205+ VariableType :: MapStringYaml ( f) => f
206+ . final_value
207+ . as_ref ( )
208+ . or ( f. default . as_ref ( ) )
209+ . cloned ( )
210+ . map ( TrivialValue :: MapStringYaml ) ,
197211 VariableType :: Yaml ( f) => f
198212 . final_value
199213 . as_ref ( )
0 commit comments