@@ -30,6 +30,8 @@ public class ApiEndpoint {
30
30
return Extensions . DistinctBy ( this . CsharpMethods . ToList ( ) , m=> m . ReturnType + "--" + m . FullName + "--" + m . Arguments ) ;
31
31
}
32
32
33
+ public IDictionary < string >
34
+
33
35
public IEnumerable < CsharpMethod > CsharpMethods {
34
36
get
35
37
{
@@ -120,6 +122,7 @@ public class CsharpMethod {
120
122
public string Path { get ; set ; }
121
123
public string Arguments { get ; set ; }
122
124
public IEnumerable < ApiUrlPart > Parts { get ; set ; }
125
+ public ApiUrl Url { get ; set ; }
123
126
}
124
127
public class ApiBody {
125
128
public string Description { get ; set ; }
@@ -147,8 +150,10 @@ public static class ApiGenerator
147
150
{
148
151
private readonly static string _listingUrl = "https://github.com/elasticsearch/elasticsearch-rest-api-spec/tree/master/api" ;
149
152
private readonly static string _rawUrlPrefix = "https://raw.github.com/elasticsearch/elasticsearch-rest-api-spec/master/api/" ;
153
+ private readonly static string _nestFolder = @"..\..\src\Nest\" ;
150
154
private readonly static RazorMachine _razorMachine = new RazorMachine ( ) ;
151
155
156
+
152
157
static ApiGenerator ( ) {
153
158
}
154
159
public static string PascalCase ( string s )
@@ -216,14 +221,14 @@ public static class ApiGenerator
216
221
217
222
public static void GenerateClientInterface ( RestApiSpec model )
218
223
{
219
- var targetFile = @"..\Nest\ IRawElasticClient.cs";
224
+ var targetFile = _nestFolder + @" IRawElasticClient.cs";
220
225
var source = _razorMachine . Execute ( File . ReadAllText ( @"Views\IRawElasticClient.cshtml" ) , model ) . ToString ( ) ;
221
226
File . WriteAllText ( targetFile , source ) ;
222
227
}
223
228
224
229
public static void GenerateQueryStringParameters ( RestApiSpec model )
225
230
{
226
- var targetFile = @"..\Nest\ QueryStringParameters\GeneratedQueryStringParameters.cs";
231
+ var targetFile = _nestFolder + @" QueryStringParameters\GeneratedQueryStringParameters.cs";
227
232
var source = _razorMachine . Execute ( File . ReadAllText ( @"Views\GeneratedQueryStringParameters.cshtml" ) , model ) . ToString ( ) ;
228
233
File . WriteAllText ( targetFile , source ) ;
229
234
}
0 commit comments