@@ -35,7 +35,7 @@ public CreateCommand()
35
35
// initialize file helper classes
36
36
FileWriter fileWriter = new FileWriter ( ) ;
37
37
FileNameGenerator fileNameGenerator = new FileNameGenerator ( ) ;
38
- CreatorFileNames creatorFileNames = fileNameGenerator . GenerateCreatorLinkedFileNames ( ) ;
38
+ FileNames fileNames = fileNameGenerator . GenerateFileNames ( creatorConfig . apimServiceName ) ;
39
39
40
40
// initialize template creator classes
41
41
APIVersionSetTemplateCreator apiVersionSetTemplateCreator = new APIVersionSetTemplateCreator ( ) ;
@@ -96,40 +96,40 @@ public CreateCommand()
96
96
if ( creatorConfig . linked == true )
97
97
{
98
98
// create linked master template
99
- Template masterTemplate = masterTemplateCreator . CreateLinkedMasterTemplate ( apiVersionSetsTemplate , productsTemplate , loggersTemplate , backendsTemplate , authorizationServersTemplate , apiInformation , creatorFileNames , fileNameGenerator ) ;
100
- fileWriter . WriteJSONToFile ( masterTemplate , String . Concat ( creatorConfig . outputLocation , creatorFileNames . linkedMaster ) ) ;
99
+ Template masterTemplate = masterTemplateCreator . CreateLinkedMasterTemplate ( apiVersionSetsTemplate , productsTemplate , loggersTemplate , backendsTemplate , authorizationServersTemplate , apiInformation , fileNames , creatorConfig . apimServiceName , fileNameGenerator ) ;
100
+ fileWriter . WriteJSONToFile ( masterTemplate , String . Concat ( creatorConfig . outputLocation , fileNames . linkedMaster ) ) ;
101
101
}
102
102
foreach ( Template apiTemplate in apiTemplates )
103
103
{
104
104
APITemplateResource apiResource = apiTemplate . resources . FirstOrDefault ( resource => resource . type == ResourceTypeConstants . API ) as APITemplateResource ;
105
105
APIConfig providedAPIConfiguration = creatorConfig . apis . FirstOrDefault ( api => apiResource . name . Contains ( api . name ) ) ;
106
106
// if the api version is not null the api is split into multiple templates. If the template is split and the content value has been set, then the template is for a subsequent api
107
- string apiFileName = fileNameGenerator . GenerateAPIFileName ( providedAPIConfiguration . name , apiTemplateCreator . isSplitAPI ( providedAPIConfiguration ) , apiResource . properties . value == null ) ;
107
+ string apiFileName = fileNameGenerator . GenerateCreatorAPIFileName ( providedAPIConfiguration . name , apiTemplateCreator . isSplitAPI ( providedAPIConfiguration ) , apiResource . properties . value == null , creatorConfig . apimServiceName ) ;
108
108
fileWriter . WriteJSONToFile ( apiTemplate , String . Concat ( creatorConfig . outputLocation , apiFileName ) ) ;
109
109
}
110
110
if ( apiVersionSetsTemplate != null )
111
111
{
112
- fileWriter . WriteJSONToFile ( apiVersionSetsTemplate , String . Concat ( creatorConfig . outputLocation , creatorFileNames . apiVersionSets ) ) ;
112
+ fileWriter . WriteJSONToFile ( apiVersionSetsTemplate , String . Concat ( creatorConfig . outputLocation , fileNames . apiVersionSets ) ) ;
113
113
}
114
114
if ( productsTemplate != null )
115
115
{
116
- fileWriter . WriteJSONToFile ( productsTemplate , String . Concat ( creatorConfig . outputLocation , creatorFileNames . products ) ) ;
116
+ fileWriter . WriteJSONToFile ( productsTemplate , String . Concat ( creatorConfig . outputLocation , fileNames . products ) ) ;
117
117
}
118
118
if ( loggersTemplate != null )
119
119
{
120
- fileWriter . WriteJSONToFile ( loggersTemplate , String . Concat ( creatorConfig . outputLocation , creatorFileNames . loggers ) ) ;
120
+ fileWriter . WriteJSONToFile ( loggersTemplate , String . Concat ( creatorConfig . outputLocation , fileNames . loggers ) ) ;
121
121
}
122
122
if ( backendsTemplate != null )
123
123
{
124
- fileWriter . WriteJSONToFile ( backendsTemplate , String . Concat ( creatorConfig . outputLocation , creatorFileNames . backends ) ) ;
124
+ fileWriter . WriteJSONToFile ( backendsTemplate , String . Concat ( creatorConfig . outputLocation , fileNames . backends ) ) ;
125
125
}
126
126
if ( authorizationServersTemplate != null )
127
127
{
128
- fileWriter . WriteJSONToFile ( authorizationServersTemplate , String . Concat ( creatorConfig . outputLocation , creatorFileNames . authorizationServers ) ) ;
128
+ fileWriter . WriteJSONToFile ( authorizationServersTemplate , String . Concat ( creatorConfig . outputLocation , fileNames . authorizationServers ) ) ;
129
129
}
130
130
131
131
// write parameters to outputLocation
132
- fileWriter . WriteJSONToFile ( masterTemplateParameters , String . Concat ( creatorConfig . outputLocation , creatorConfig . linked == true ? creatorFileNames . linkedParameters : creatorFileNames . unlinkedParameters ) ) ;
132
+ fileWriter . WriteJSONToFile ( masterTemplateParameters , String . Concat ( creatorConfig . outputLocation , fileNames . parameters ) ) ;
133
133
Console . WriteLine ( "Templates written to output location" ) ;
134
134
Console . WriteLine ( "Press any key to exit process:" ) ;
135
135
#if DEBUG
0 commit comments