@@ -18,11 +18,13 @@ use crate::{
1818
1919use super :: Validation ;
2020
21+ // This must be kept up to date when adding role keys in eos_cli_config_gen schema.
22+ // TODO: Eventually this will go away as we stop warning.
2123const EOS_CLI_CONFIG_GEN_ROLE_KEYS : [ & str ; 6 ] = [
2224 "eos_cli_config_gen_documentation" ,
2325 "custom_templates" ,
2426 "eos_cli_config_gen_configuration" ,
25- "avd_eos_cli_config_gen_input_dir " ,
27+ "read_structured_config_from_file " ,
2628 "avd_eos_cli_config_gen_validate_inputs_batch_size" ,
2729 "avd_structured_config_file_format" ,
2830] ;
@@ -85,7 +87,8 @@ fn validate_keys(schema: &Dict, input: &Map<String, Value>, ctx: &mut Context) {
8587 // When at the root level, if warn_eos_cli_config_gen_keys is enabled, get the keys from the eos_cli_config_gen schema.
8688 let eos_cli_config_gen_keys: Option < & OrderMap < String , AnySchema > > = {
8789 if ctx. state . path . is_empty ( ) && ctx. configuration . warn_eos_cli_config_gen_keys {
88- <& Dict >:: try_from ( & ctx. store . eos_cli_config_gen ) . ok ( )
90+ <& Dict >:: try_from ( & ctx. store . eos_cli_config_gen )
91+ . ok ( )
8992 . and_then ( |d| d. keys . as_ref ( ) )
9093 } else {
9194 None
@@ -901,13 +904,15 @@ mod tests {
901904 #[ test]
902905 fn validate_eos_designs_with_eos_cli_config_gen_role_keys_no_warning ( ) {
903906 // Test that the special eos_cli_config_gen role keys are ignored without warnings.
904- // These keys are: eos_cli_config_gen_documentation, custom_templates, eos_cli_config_gen_configuration
905907 let store = get_test_store ( ) ;
906908 let input = serde_json:: json!( {
907909 "key3" : "valid_eos_designs_key" ,
908- "eos_cli_config_gen_documentation" : "should be ignored" ,
910+ "avd_eos_cli_config_gen_validate_inputs_batch_size" : "should be ignored" ,
911+ "avd_structured_config_file_format" : "should be ignored" ,
909912 "custom_templates" : "should be ignored" ,
910- "eos_cli_config_gen_configuration" : "should be ignored"
913+ "eos_cli_config_gen_configuration" : "should be ignored" ,
914+ "eos_cli_config_gen_documentation" : "should be ignored" ,
915+ "read_structured_config_from_file" : "should be ignored" ,
911916 } ) ;
912917
913918 let configuration = Configuration {
0 commit comments