Skip to content

Commit 412fe14

Browse files
committed
Fix generated XML comments
Closes #1787
1 parent 111956e commit 412fe14

File tree

15 files changed

+7473
-6677
lines changed

15 files changed

+7473
-6677
lines changed

src/CodeGeneration/CodeGeneration.LowLevelClient/ApiEndpoints/root.html

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#">
88
<meta charset='utf-8'>
99

10-
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-e77dfa04bcdf3d337a9c03763554cedd313bf2c5745fb51fbe00ec6e40e72415.css" media="all" rel="stylesheet" />
11-
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github2-a87cd6dd740cc44b59219652052d8b935af35c8063ec31afbd38fb52cc526468.css" media="all" rel="stylesheet" />
10+
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-8eebbcd276790f4987d7e97bd0d6a84af74f8ebdc119dc022af6c47d494fa64e.css" media="all" rel="stylesheet" />
11+
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github2-11604c0d8699009dd51b83a0ae1d8803d4b4a6296cb54624e5a1d0bb631afbbb.css" media="all" rel="stylesheet" />
1212

1313

1414

1515

16-
<link as="script" href="https://assets-cdn.github.com/assets/frameworks-94269375693b06dc9fd36e307886d1a2de3be866618c67ebb7a37fc3a75ee1d6.js" rel="preload" />
17-
<link as="script" href="https://assets-cdn.github.com/assets/github-6249ebe309060c28b3c5f09b7a752730fa198bb47f6bc852660b70143dd44d5c.js" rel="preload" />
16+
<link as="script" href="https://assets-cdn.github.com/assets/frameworks-cd88cfa185f31c4c64e9a8c91cc4e9a48397b1c75fe991a83213b993636997af.js" rel="preload" />
17+
<link as="script" href="https://assets-cdn.github.com/assets/github-fb6d86d3abdd91a2a514dc1a43033b720c04ef5d9eb67fcecabb53ad96464e55.js" rel="preload" />
1818

1919
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2020
<meta http-equiv="Content-Language" content="en">
@@ -53,7 +53,7 @@
5353
<meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA">
5454
<meta name="google-analytics" content="UA-3769691-2">
5555

56-
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="6423B3ED:5178:28105E:56B1192E" name="octolytics-dimension-request_id" />
56+
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="3CF105D8:09AE:A6302A:56B18DA6" name="octolytics-dimension-request_id" />
5757
<meta content="/&lt;user-name&gt;/&lt;repo-name&gt;/files/disambiguate" data-pjax-transient="true" name="analytics-location" />
5858

5959

@@ -70,9 +70,9 @@
7070
<link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#4078c0">
7171
<link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
7272

73-
<meta content="24c3eac20c35586a6b9ab6528c4d0e3da8163748" name="form-nonce" />
73+
<meta content="71102a7af90e93352bfd66049d3d9ff6f6da48dc" name="form-nonce" />
7474

75-
<meta http-equiv="x-pjax-version" content="94e8dec045c90759a18f4d8433ab865c">
75+
<meta http-equiv="x-pjax-version" content="79995532d2f8bcd2fede9137ac37a0bf">
7676

7777

7878
<meta name="description" content="elasticsearch - Open Source, Distributed, RESTful Search Engine">
@@ -171,7 +171,7 @@
171171
Watch
172172
</a>
173173
<a class="social-count" href="/elastic/elasticsearch/watchers">
174-
1,507
174+
1,509
175175
</a>
176176

177177
</li>
@@ -185,7 +185,7 @@
185185
</a>
186186

187187
<a class="social-count js-social-count" href="/elastic/elasticsearch/stargazers">
188-
14,942
188+
14,974
189189
</a>
190190

191191
</li>
@@ -199,7 +199,7 @@
199199
</a>
200200

201201
<a href="/elastic/elasticsearch/network" class="social-count">
202-
4,926
202+
4,933
203203
</a>
204204
</li>
205205
</ul>
@@ -230,7 +230,7 @@ <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-titl
230230
<a href="/elastic/elasticsearch/issues" class="js-selected-navigation-item reponav-item" data-hotkey="g i" data-selected-links="repo_issues repo_labels repo_milestones /elastic/elasticsearch/issues">
231231
<svg aria-hidden="true" class="octicon octicon-issue-opened" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7S10.14 13.7 7 13.7 1.3 11.14 1.3 8s2.56-5.7 5.7-5.7m0-1.3C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7S10.86 1 7 1z m1 3H6v5h2V4z m0 6H6v2h2V10z"></path></svg>
232232
Issues
233-
<span class="counter">938</span>
233+
<span class="counter">940</span>
234234
</a>
235235
<a href="/elastic/elasticsearch/pulls" class="js-selected-navigation-item reponav-item" data-hotkey="g p" data-selected-links="repo_pulls /elastic/elasticsearch/pulls">
236236
<svg aria-hidden="true" class="octicon octicon-git-pull-request" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M11 11.28c0-1.73 0-6.28 0-6.28-0.03-0.78-0.34-1.47-0.94-2.06s-1.28-0.91-2.06-0.94c0 0-1.02 0-1 0V0L4 3l3 3V4h1c0.27 0.02 0.48 0.11 0.69 0.31s0.3 0.42 0.31 0.69v6.28c-0.59 0.34-1 0.98-1 1.72 0 1.11 0.89 2 2 2s2-0.89 2-2c0-0.73-0.41-1.38-1-1.72z m-1 2.92c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2zM4 3c0-1.11-0.89-2-2-2S0 1.89 0 3c0 0.73 0.41 1.38 1 1.72 0 1.55 0 5.56 0 6.56-0.59 0.34-1 0.98-1 1.72 0 1.11 0.89 2 2 2s2-0.89 2-2c0-0.73-0.41-1.38-1-1.72V4.72c0.59-0.34 1-0.98 1-1.72z m-0.8 10c0 0.66-0.55 1.2-1.2 1.2s-1.2-0.55-1.2-1.2 0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2z m-1.2-8.8c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2z"></path></svg>
@@ -1716,7 +1716,7 @@ <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-titl
17161716
<div class="btn-group right">
17171717

17181718
<button class="btn btn-sm disabled tooltipped tooltipped-n" aria-label="You must be signed in to make or propose changes" type="button">
1719-
New file
1719+
New file
17201720
</button>
17211721

17221722

@@ -1728,10 +1728,13 @@ <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-titl
17281728
History
17291729
</a>
17301730
</div>
1731+
1732+
17311733
<div class="breadcrumb"><span class="repo-root js-repo-root"><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/elastic/elasticsearch/tree/2.0" class="" data-branch="2.0" data-pjax="true" itemscope="url"><span itemprop="title">elasticsearch</span></a></span></span><span class="separator">/</span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/elastic/elasticsearch/tree/2.0/plugins" class="" data-branch="2.0" data-pjax="true" itemscope="url"><span itemprop="title">plugins</span></a></span><span class="separator">/</span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/elastic/elasticsearch/tree/2.0/plugins/delete-by-query" class="" data-branch="2.0" data-pjax="true" itemscope="url"><span itemprop="title">delete-by-query</span></a></span><span class="separator">/</span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/elastic/elasticsearch/tree/2.0/plugins/delete-by-query/rest-api-spec" class="" data-branch="2.0" data-pjax="true" itemscope="url"><span itemprop="title">rest-api-spec</span></a></span><span class="separator">/</span><strong class="final-path">api</strong><span class="separator">/</span></div>
17321734
</div>
17331735

17341736

1737+
17351738
<div class="branch-infobar">
17361739
<span class="right">
17371740
<a class="muted-link" href="/elastic/elasticsearch/pull/new/2.0">
@@ -1744,7 +1747,7 @@ <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-titl
17441747
</a>
17451748
</span>
17461749

1747-
This branch is 766 commits ahead, 4823 commits behind master.
1750+
This branch is 766 commits ahead, 4834 commits behind master.
17481751
</div>
17491752

17501753
<include-fragment class="commit-tease commit-loader" src="/elastic/elasticsearch/tree-commit/3365606603139b4d514b3200b178ee271400b56c/plugins/delete-by-query/rest-api-spec/api">
@@ -1757,6 +1760,7 @@ <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-titl
17571760
</div>
17581761
</include-fragment>
17591762

1763+
17601764
<include-fragment class="file-wrap" src="/elastic/elasticsearch/file-list/2.0/plugins/delete-by-query/rest-api-spec/api">
17611765

17621766
<a href="/elastic/elasticsearch/tree/3365606603139b4d514b3200b178ee271400b56c/plugins/delete-by-query/rest-api-spec/api" class="hidden js-permalink-shortcut" data-hotkey="y">Permalink</a>
@@ -1828,7 +1832,7 @@ <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-titl
18281832
<svg aria-hidden="true" class="mega-octicon octicon-mark-github" height="24" role="img" title="GitHub " version="1.1" viewBox="0 0 16 16" width="24"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59 0.4 0.07 0.55-0.17 0.55-0.38 0-0.19-0.01-0.82-0.01-1.49-2.01 0.37-2.53-0.49-2.69-0.94-0.09-0.23-0.48-0.94-0.82-1.13-0.28-0.15-0.68-0.52-0.01-0.53 0.63-0.01 1.08 0.58 1.23 0.82 0.72 1.21 1.87 0.87 2.33 0.66 0.07-0.52 0.28-0.87 0.51-1.07-1.78-0.2-3.64-0.89-3.64-3.95 0-0.87 0.31-1.59 0.82-2.15-0.08-0.2-0.36-1.02 0.08-2.12 0 0 0.67-0.21 2.2 0.82 0.64-0.18 1.32-0.27 2-0.27 0.68 0 1.36 0.09 2 0.27 1.53-1.04 2.2-0.82 2.2-0.82 0.44 1.1 0.16 1.92 0.08 2.12 0.51 0.56 0.82 1.27 0.82 2.15 0 3.07-1.87 3.75-3.65 3.95 0.29 0.25 0.54 0.73 0.54 1.48 0 1.07-0.01 1.93-0.01 2.2 0 0.21 0.15 0.46 0.55 0.38C13.71 14.53 16 11.53 16 8 16 3.58 12.42 0 8 0z"></path></svg>
18291833
</a>
18301834
<ul class="site-footer-links">
1831-
<li>&copy; 2016 <span title="0.51954s from github-fe132-cp1-prd.iad.github.net">GitHub</span>, Inc.</li>
1835+
<li>&copy; 2016 <span title="0.06609s from github-fe119-cp1-prd.iad.github.net">GitHub</span>, Inc.</li>
18321836
<li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
18331837
<li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
18341838
<li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
@@ -1854,8 +1858,8 @@ <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-titl
18541858

18551859

18561860
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/compat-a0cee5d8d4fb535c0f41971d037b32e852a56ddca5bf67bb2124e426a2d813a5.js"></script>
1857-
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/frameworks-94269375693b06dc9fd36e307886d1a2de3be866618c67ebb7a37fc3a75ee1d6.js"></script>
1858-
<script async="async" crossorigin="anonymous" src="https://assets-cdn.github.com/assets/github-6249ebe309060c28b3c5f09b7a752730fa198bb47f6bc852660b70143dd44d5c.js"></script>
1861+
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/frameworks-cd88cfa185f31c4c64e9a8c91cc4e9a48397b1c75fe991a83213b993636997af.js"></script>
1862+
<script async="async" crossorigin="anonymous" src="https://assets-cdn.github.com/assets/github-fb6d86d3abdd91a2a514dc1a43033b720c04ef5d9eb67fcecabb53ad96464e55.js"></script>
18591863

18601864

18611865

src/CodeGeneration/CodeGeneration.LowLevelClient/ApiGenerator.cs

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717

1818
namespace CodeGeneration.LowLevelClient
1919
{
20-
public static class ApiGenerator
20+
public class ApiGenerator
2121
{
22-
private static readonly string NestFolder = @"..\..\..\..\..\src\Nest\";
23-
private static readonly string EsNetFolder = @"..\..\..\..\..\src\Elasticsearch.Net\";
24-
private static readonly string ViewFolder = @"..\..\Views\";
25-
private static readonly string ApiEndpointsFolder = @"..\..\ApiEndpoints\";
22+
private static string NestFolder;
23+
private static string EsNetFolder;
24+
private static string ViewFolder;
25+
private static string ApiEndpointsFolder;
2626
private static readonly RazorMachine RazorHelper;
27-
2827
private static readonly string Version = "2.0";
2928
private static readonly List<string> ApiListings = new List<string>
3029
{
@@ -38,20 +37,42 @@ static ApiGenerator()
3837
{
3938
RazorHelper = new RazorMachine();
4039
Assembly = typeof(ApiGenerator).Assembly;
40+
41+
var directoryInfo = new DirectoryInfo(Directory.GetCurrentDirectory());
42+
43+
if (directoryInfo.Name == "CodeGeneration.LowLevelClient" &&
44+
directoryInfo.Parent != null &&
45+
directoryInfo.Parent.Name == "CodeGeneration")
46+
{
47+
// running as a dnx project
48+
NestFolder = @"..\..\..\src\Nest\";
49+
EsNetFolder = @"..\..\..\src\Elasticsearch.Net\";
50+
ViewFolder = @"Views\";
51+
ApiEndpointsFolder = @"ApiEndpoints\";
52+
}
53+
else
54+
{
55+
NestFolder = @"..\..\..\..\..\src\Nest\";
56+
EsNetFolder = @"..\..\..\..\..\src\Elasticsearch.Net\";
57+
ViewFolder = @"..\..\Views\";
58+
ApiEndpointsFolder = @"..\..\ApiEndpoints\";
59+
}
4160
}
61+
4262
public static string PascalCase(string s)
4363
{
4464
var textInfo = new CultureInfo("en-US").TextInfo;
4565
return textInfo.ToTitleCase(s.ToLowerInvariant()).Replace("_", string.Empty).Replace(".", string.Empty);
4666
}
47-
public static void GenerateEndpointFiles()
67+
68+
public void GenerateEndpointFiles()
4869
{
4970
Console.WriteLine("Getting a listing of all the api endpoints from the elasticsearch-rest-api-spec repos");
5071
foreach(var listing in ApiListings.Select(l=>l.Replace("{version}", Version)))
5172
DownloadJsonDefinitions(listing);
5273
}
5374

54-
private static void DownloadJsonDefinitions(string listingUrl)
75+
private void DownloadJsonDefinitions(string listingUrl)
5576
{
5677
using (var client = new WebClient())
5778
{
@@ -60,7 +81,7 @@ private static void DownloadJsonDefinitions(string listingUrl)
6081
}
6182
}
6283

63-
private static void FindJsonFilesOnListing(string listingUrl, string html)
84+
private void FindJsonFilesOnListing(string listingUrl, string html)
6485
{
6586
var dom = CQ.Create(html);
6687

@@ -73,7 +94,9 @@ private static void FindJsonFilesOnListing(string listingUrl, string html)
7394

7495
endpoints.ForEach(s => WriteEndpointFile(listingUrl, s));
7596
}
76-
private static void WriteEndpointFile(string listingUrl, string s)
97+
98+
99+
private void WriteEndpointFile(string listingUrl, string s)
77100
{
78101
using (var client = new WebClient())
79102
{
@@ -86,7 +109,7 @@ private static void WriteEndpointFile(string listingUrl, string s)
86109
}
87110

88111

89-
public static RestApiSpec GetRestApiSpec()
112+
public RestApiSpec GetRestApiSpec()
90113
{
91114
var spec = new RestApiSpec
92115
{
@@ -100,10 +123,11 @@ public static RestApiSpec GetRestApiSpec()
100123
return spec;
101124
}
102125

103-
private static KeyValuePair<string, ApiEndpoint> CreateApiEndpoint(string jsonFile)
126+
private KeyValuePair<string, ApiEndpoint> CreateApiEndpoint(string jsonFile)
104127
{
105128
var json = File.ReadAllText(jsonFile);
106129
var endpoint = JsonConvert.DeserializeObject<Dictionary<string, ApiEndpoint>>(json).First();
130+
endpoint.Value.Generator = this;
107131
endpoint.Value.CsharpMethodName = CreateMethodName(endpoint.Key);
108132
return endpoint;
109133
}
@@ -116,7 +140,7 @@ private static string LocalUri(string file)
116140
return fileUri;
117141
}
118142

119-
private static readonly Dictionary<string, string> MethodNameOverrides =
143+
private readonly Dictionary<string, string> MethodNameOverrides =
120144
(from f in new DirectoryInfo(NestFolder).GetFiles("*.cs", SearchOption.AllDirectories)
121145
let contents = File.ReadAllText(f.FullName)
122146
let c = Regex.Replace(contents, @"^.+\[DescriptorFor\(""([^ \r\n]+)""\)\].*$", "$1", RegexOptions.Singleline)
@@ -125,7 +149,7 @@ private static string LocalUri(string file)
125149
.DistinctBy(v => v.Key)
126150
.ToDictionary(k => k.Key, v => v.Value.Replace(".cs", ""));
127151

128-
private static readonly Dictionary<string, string> KnownDescriptors =
152+
private readonly Dictionary<string, string> KnownDescriptors =
129153
(from f in new DirectoryInfo(NestFolder).GetFiles("*Request.cs", SearchOption.AllDirectories)
130154
let contents = File.ReadAllText(f.FullName)
131155
let c = Regex.Replace(contents, @"^.+class ([^ \r\n]+Descriptor(?:<[^>\r\n]+>)?[^ \r\n]*).*$", "$1", RegexOptions.Singleline)
@@ -134,7 +158,7 @@ private static string LocalUri(string file)
134158
.OrderBy(v=>v.Key)
135159
.ToDictionary(k => k.Key, v => v.Value);
136160

137-
private static readonly Dictionary<string, string> KnownRequests =
161+
private readonly Dictionary<string, string> KnownRequests =
138162
(from f in new DirectoryInfo(NestFolder).GetFiles("*Request.cs", SearchOption.AllDirectories)
139163
let contents = File.ReadAllText(f.FullName)
140164
let c = Regex.Replace(contents, @"^.+interface ([^ \r\n]+Request(?:<[^>\r\n]+>)?[^ \r\n]*).*$", "$1", RegexOptions.Singleline)
@@ -146,7 +170,7 @@ where c.StartsWith("I") && c.Contains("Request")
146170

147171
//Patches a method name for the exceptions (IndicesStats needs better unique names for all the url endpoints)
148172
//or to get rid of double verbs in an method name i,e ClusterGetSettingsGet > ClusterGetSettings
149-
public static void PatchMethod(CsharpMethod method)
173+
public void PatchMethod(CsharpMethod method)
150174
{
151175
Func<string, bool> ms = s => method.FullName.StartsWith(s);
152176
Func<string, bool> pc = s => method.Path.Contains(s);
@@ -260,62 +284,62 @@ public static string CreateMethodName(string apiEnpointKey)
260284
return PascalCase(apiEnpointKey);
261285
}
262286

263-
public static void GenerateClientInterface(RestApiSpec model)
287+
public void GenerateClientInterface(RestApiSpec model)
264288
{
265289
var targetFile = EsNetFolder + @"IElasticsearchClient.Generated.cs";
266290
var source = RazorHelper.Execute(File.ReadAllText(ViewFolder + @"IElasticsearchClient.Generated.cshtml"), model).ToString();
267291
File.WriteAllText(targetFile, source);
268292
}
269293

270294

271-
public static void GenerateRawDispatch(RestApiSpec model)
295+
public void GenerateRawDispatch(RestApiSpec model)
272296
{
273297
var targetFile = NestFolder + @"_Generated/_LowLevelDispatch.Generated.cs";
274298
var source = RazorHelper.Execute(File.ReadAllText(ViewFolder + @"_LowLevelDispatch.Generated.cshtml"), model).ToString();
275299
File.WriteAllText(targetFile, source);
276300
}
277-
public static void GenerateRawClient(RestApiSpec model)
301+
public void GenerateRawClient(RestApiSpec model)
278302
{
279303
var targetFile = EsNetFolder + @"ElasticsearchClient.Generated.cs";
280304
var source = RazorHelper.Execute(File.ReadAllText(ViewFolder + @"ElasticsearchClient.Generated.cshtml"), model).ToString();
281305
File.WriteAllText(targetFile, source);
282306
}
283307

284-
public static void GenerateDescriptors(RestApiSpec model)
308+
public void GenerateDescriptors(RestApiSpec model)
285309
{
286310
var targetFile = NestFolder + @"_Generated\_Descriptors.Generated.cs";
287311
var source = RazorHelper.Execute(File.ReadAllText(ViewFolder + @"_Descriptors.Generated.cshtml"), model).ToString();
288312
File.WriteAllText(targetFile, source);
289313
}
290314

291-
public static void GenerateRequests(RestApiSpec model)
315+
public void GenerateRequests(RestApiSpec model)
292316
{
293317
var targetFile = NestFolder + @"_Generated\_Requests.Generated.cs";
294318
var source = RazorHelper.Execute(File.ReadAllText(ViewFolder + @"_Requests.Generated.cshtml"), model).ToString();
295319
File.WriteAllText(targetFile, source);
296320
}
297321

298-
public static void GenerateRequestParameters(RestApiSpec model)
322+
public void GenerateRequestParameters(RestApiSpec model)
299323
{
300324
var targetFile = EsNetFolder + @"Domain\RequestParameters\RequestParameters.Generated.cs";
301325
var source = RazorHelper.Execute(File.ReadAllText(ViewFolder + @"RequestParameters.Generated.cshtml"), model).ToString();
302326
File.WriteAllText(targetFile, source);
303327
}
304328

305-
public static void GenerateRequestParametersExtensions(RestApiSpec model)
329+
public void GenerateRequestParametersExtensions(RestApiSpec model)
306330
{
307331
var targetFile = NestFolder + @"_Generated\_RequestParametersExtensions.Generated.cs";
308332
var source = RazorHelper.Execute(File.ReadAllText(ViewFolder + @"_RequestParametersExtensions.Generated.cshtml"), model).ToString();
309333
File.WriteAllText(targetFile, source);
310334
}
311-
public static void GenerateEnums(RestApiSpec model)
335+
public void GenerateEnums(RestApiSpec model)
312336
{
313337
var targetFile = EsNetFolder + @"Domain\Enums.Generated.cs";
314338
var source = RazorHelper.Execute(File.ReadAllText(ViewFolder + @"Enums.Generated.cshtml"), model).ToString();
315339
File.WriteAllText(targetFile, source);
316340
}
317341

318-
private static void WriteToEndpointsFolder(string filename, string contents)
342+
private void WriteToEndpointsFolder(string filename, string contents)
319343
{
320344
if (!Directory.Exists(ApiEndpointsFolder))
321345
Directory.CreateDirectory(ApiEndpointsFolder);

0 commit comments

Comments
 (0)