@@ -30,6 +30,8 @@ public class ApiEndpoint {
3030 return Extensions . DistinctBy ( this . CsharpMethods . ToList ( ) , m=> m . ReturnType + "--" + m . FullName + "--" + m . Arguments ) ;
3131 }
3232
33+ public IDictionary < string >
34+
3335 public IEnumerable < CsharpMethod > CsharpMethods {
3436 get
3537 {
@@ -120,6 +122,7 @@ public class CsharpMethod {
120122 public string Path { get ; set ; }
121123 public string Arguments { get ; set ; }
122124 public IEnumerable < ApiUrlPart > Parts { get ; set ; }
125+ public ApiUrl Url { get ; set ; }
123126}
124127public class ApiBody {
125128 public string Description { get ; set ; }
@@ -147,8 +150,10 @@ public static class ApiGenerator
147150{
148151 private readonly static string _listingUrl = "https://github.com/elasticsearch/elasticsearch-rest-api-spec/tree/master/api" ;
149152 private readonly static string _rawUrlPrefix = "https://raw.github.com/elasticsearch/elasticsearch-rest-api-spec/master/api/" ;
153+ private readonly static string _nestFolder = @"..\..\src\Nest\" ;
150154 private readonly static RazorMachine _razorMachine = new RazorMachine ( ) ;
151155
156+
152157 static ApiGenerator ( ) {
153158 }
154159 public static string PascalCase ( string s )
@@ -216,14 +221,14 @@ public static class ApiGenerator
216221
217222 public static void GenerateClientInterface ( RestApiSpec model )
218223 {
219- var targetFile = @"..\Nest\ IRawElasticClient.cs";
224+ var targetFile = _nestFolder + @" IRawElasticClient.cs";
220225 var source = _razorMachine . Execute ( File . ReadAllText ( @"Views\IRawElasticClient.cshtml" ) , model ) . ToString ( ) ;
221226 File . WriteAllText ( targetFile , source ) ;
222227 }
223228
224229 public static void GenerateQueryStringParameters ( RestApiSpec model )
225230 {
226- var targetFile = @"..\Nest\ QueryStringParameters\GeneratedQueryStringParameters.cs";
231+ var targetFile = _nestFolder + @" QueryStringParameters\GeneratedQueryStringParameters.cs";
227232 var source = _razorMachine . Execute ( File . ReadAllText ( @"Views\GeneratedQueryStringParameters.cshtml" ) , model ) . ToString ( ) ;
228233 File . WriteAllText ( targetFile , source ) ;
229234 }
0 commit comments