@@ -10,8 +10,8 @@ PropertyTree buildConfigSchema()
1010{
1111 PropertyTree schema;
1212 auto & cfg = schema.get (" config" );
13- cfg.setAttribute (" description " , " Main config for plugin" );
14- cfg.setAttribute (" required " , true );
13+ cfg.setAttribute (property_attribute::DOC , " Main config for plugin" );
14+ cfg.setAttribute (property_attribute::REQUIRED , true );
1515 std::map<int , std::string> return_options;
1616 return_options[0 ] = " Error" ;
1717 return_options[1 ] = " Successful" ;
@@ -21,40 +21,40 @@ PropertyTree buildConfigSchema()
2121 // conditional
2222 {
2323 auto & prop = cfg.get (" conditional" );
24- prop.setAttribute (" type " , property_type::BOOL);
25- prop.setAttribute (" default " , true );
26- prop.setAttribute (" description " , " Enable conditional execution" );
27- prop.setAttribute (" required " , true );
24+ prop.setAttribute (property_attribute::TYPE , property_type::BOOL);
25+ prop.setAttribute (property_attribute::DEFAULT , true );
26+ prop.setAttribute (property_attribute::DOC , " Enable conditional execution" );
27+ prop.setAttribute (property_attribute::REQUIRED , true );
2828 prop.addValidator (validateRequired);
2929 }
3030 // inputs
3131 {
3232 auto & inputs = cfg.get (" inputs" );
33- inputs.setAttribute (" description " , " Input sources" );
34- inputs.setAttribute (" required " , true );
33+ inputs.setAttribute (property_attribute::DOC , " Input sources" );
34+ inputs.setAttribute (property_attribute::REQUIRED , true );
3535 // program
3636 {
3737 auto & prop = inputs.get (" program" );
38- prop.setAttribute (" type " , property_type::STRING);
39- prop.setAttribute (" description " , " The composite instruction" );
40- prop.setAttribute (" required " , true );
38+ prop.setAttribute (property_attribute::TYPE , property_type::STRING);
39+ prop.setAttribute (property_attribute::DOC , " The composite instruction" );
40+ prop.setAttribute (property_attribute::REQUIRED , true );
4141 prop.addValidator (validateRequired);
4242 }
4343 // environment
4444 {
4545 auto & prop = inputs.get (" environment" );
4646 // env.setAttribute("enum", YAML::Load(R"(["dev","stag","prod"])"));
47- prop.setAttribute (" type " , property_type::STRING);
48- prop.setAttribute (" description " , " The tesseract environment" );
49- prop.setAttribute (" required " , true );
47+ prop.setAttribute (property_attribute::TYPE , property_type::STRING);
48+ prop.setAttribute (property_attribute::DOC , " The tesseract environment" );
49+ prop.setAttribute (property_attribute::REQUIRED , true );
5050 prop.addValidator (validateRequired);
5151 }
5252 // profiles
5353 {
5454 auto & prop = inputs.get (" profiles" );
55- prop.setAttribute (" type " , property_type::STRING);
56- prop.setAttribute (" description " , " The tesseract profiles" );
57- prop.setAttribute (" required " , true );
55+ prop.setAttribute (property_attribute::TYPE , property_type::STRING);
56+ prop.setAttribute (property_attribute::DOC , " The tesseract profiles" );
57+ prop.setAttribute (property_attribute::REQUIRED , true );
5858 prop.addValidator (validateRequired);
5959 // prof.setAttribute("enum", YAML::Load(R"(["A","B"])"));
6060 // prof.addValidator(validateEnum);
@@ -72,15 +72,15 @@ PropertyTree buildConfigSchema()
7272 {
7373 auto & outs = cfg.get (" outputs" );
7474 auto & prop = outs.get (" program" );
75- prop.setAttribute (" type " , property_type::STRING);
76- prop.setAttribute (" required " , true );
75+ prop.setAttribute (property_attribute::TYPE , property_type::STRING);
76+ prop.setAttribute (property_attribute::REQUIRED , true );
7777 prop.addValidator (validateRequired);
7878 }
7979 // format_result_as_input
8080 {
8181 auto & prop = cfg.get (" format_result_as_input" );
82- prop.setAttribute (" type " , property_type::BOOL);
83- prop.setAttribute (" default " , false );
82+ prop.setAttribute (property_attribute::TYPE , property_type::BOOL);
83+ prop.setAttribute (property_attribute::DEFAULT , false );
8484 }
8585 return schema;
8686}
0 commit comments