File tree 3 files changed +15
-6
lines changed
3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,8 @@ class ApiGenerator extends Generator
138
138
* @var array Map for custom dbModels
139
139
* @example
140
140
* 'dbModel' => [
141
- * 'scenarioDefaultDescription' => " Scenario {name}", @see DbModel::$scenarioDefaultDescription
141
+ * AcceptedInputs: {scenarioName}, {scenarioConst}, {modelName}.
142
+ * 'scenarioDefaultDescription' => " Scenario {scenarioName}", @see DbModel::$scenarioDefaultDescription
142
143
* ]
143
144
*/
144
145
public $ dbModel = [];
Original file line number Diff line number Diff line change @@ -113,7 +113,8 @@ class Config extends BaseObject
113
113
* @var array Map for custom dbModels
114
114
* @example
115
115
* 'dbModel' => [
116
- * 'scenarioDefaultDescription' => " Scenario {name}", @see DbModel::$scenarioDefaultDescription
116
+ * AcceptedInputs: {scenarioName}, {scenarioConst}, {modelName}.
117
+ * 'scenarioDefaultDescription' => " Scenario {scenarioName}", @see DbModel::$scenarioDefaultDescription
117
118
* ]
118
119
*/
119
120
public $ dbModel = [];
Original file line number Diff line number Diff line change @@ -90,9 +90,9 @@ class DbModel extends BaseObject
90
90
/**
91
91
* @var string
92
92
* Here, you can set your own default description for the scenario.
93
- * You can use the {name} attribute from the schema for the YAML model .
93
+ * AcceptedInputs: {scenarioName}, {scenarioConst}, {modelName} .
94
94
*/
95
- public string $ scenarioDefaultDescription = " Scenario {name } " ;
95
+ public string $ scenarioDefaultDescription = " Scenario {scenarioName } " ;
96
96
97
97
public function getTableAlias ():string
98
98
{
@@ -237,8 +237,15 @@ private function getScenariosByOpenapiSchema(): array
237
237
$ scenarios [$ key ]['description ' ] = FormatHelper::getFormattedDescription (
238
238
!empty ($ scenario ['description ' ]) ?
239
239
$ scenario ['description ' ]
240
- : str_replace ('{name} ' , $ scenario ['name ' ], $ this ->scenarioDefaultDescription
241
- ),
240
+ : str_replace ([
241
+ '{scenarioName} ' ,
242
+ '{scenarioConst} ' ,
243
+ '{modelName} ' ,
244
+ ], [
245
+ $ scenario ['name ' ],
246
+ $ scenarios [$ key ]['const ' ],
247
+ $ this ->name ,
248
+ ], $ this ->scenarioDefaultDescription ),
242
249
5 );
243
250
}
244
251
You can’t perform that action at this time.
0 commit comments