Skip to content

Commit c520607

Browse files
committed
Tidy up ApiGenerator
- Run generator to pull in v2.3.5 rest api specs - Merge in changes pulled in from master, related to overrides on a per endpoint basis e.g. PatchMethod(), DescriptorOverridesBase - Delete rest api specs pulled in from master e.g. xpack security
1 parent 1c60b59 commit c520607

File tree

176 files changed

+14887
-14970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+14887
-14970
lines changed

src/CodeGeneration/ApiGenerator/ApiEndpoints/cluster.allocation_explain.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/CodeGeneration/ApiGenerator/ApiEndpoints/ingest.delete_pipeline.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/CodeGeneration/ApiGenerator/ApiEndpoints/ingest.get_pipeline.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/CodeGeneration/ApiGenerator/ApiEndpoints/ingest.put_pipeline.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/CodeGeneration/ApiGenerator/ApiEndpoints/ingest.simulate.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/CodeGeneration/ApiGenerator/ApiEndpoints/reindex.rethrottle.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/CodeGeneration/ApiGenerator/ApiGenerator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public class ApiGenerator
1414
{
1515
static readonly RazorMachine RazorHelper = new RazorMachine();
1616

17-
public static void Generate(params string[] folders)
17+
public static void Generate(string downloadBranch, params string[] folders)
1818
{
19-
var spec = CreateRestApiSpecModel(folders);
19+
var spec = CreateRestApiSpecModel(downloadBranch, folders);
2020
var actions = new Dictionary<Action<RestApiSpec>, string>
2121
{
2222
{ GenerateClientInterface, "Client interface" },
@@ -40,7 +40,7 @@ public static void Generate(params string[] folders)
4040
}
4141
}
4242

43-
private static RestApiSpec CreateRestApiSpecModel(string[] folders)
43+
private static RestApiSpec CreateRestApiSpecModel(string downloadBranch, string[] folders)
4444
{
4545
var directories = Directory.GetDirectories(CodeConfiguration.RestSpecificationFolder, "*", SearchOption.AllDirectories)
4646
.Where(f=>folders == null || folders.Length == 0 || folders.Contains(new DirectoryInfo(f).Name))
@@ -63,7 +63,7 @@ private static RestApiSpec CreateRestApiSpecModel(string[] folders)
6363
}
6464
}
6565

66-
return new RestApiSpec { Endpoints = endpoints };
66+
return new RestApiSpec { Endpoints = endpoints, Commit = downloadBranch };
6767
}
6868

6969

src/CodeGeneration/ApiGenerator/ApiGenerator.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<DebugSymbols>true</DebugSymbols>
2020
<DebugType>full</DebugType>
2121
<Optimize>false</Optimize>
22-
<OutputPath>..\CodeGeneration.LowLevelClient\bin\Net45\Debug\</OutputPath>
22+
<OutputPath>bin\Net45\Debug\</OutputPath>
2323
<DefineConstants>DEBUG;TRACE</DefineConstants>
2424
<ErrorReport>prompt</ErrorReport>
2525
<WarningLevel>4</WarningLevel>
@@ -28,7 +28,7 @@
2828
<PlatformTarget>AnyCPU</PlatformTarget>
2929
<DebugType>pdbonly</DebugType>
3030
<Optimize>true</Optimize>
31-
<OutputPath>..\CodeGeneration.LowLevelClient\bin\Net45\Release\</OutputPath>
31+
<OutputPath>bin\Net45\Release\</OutputPath>
3232
<DefineConstants>TRACE</DefineConstants>
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
@@ -62,13 +62,18 @@
6262
<Compile Include="Extensions.cs" />
6363
<Compile Include="Overrides\Allow404\ApiEndpointsThatAllow404.cs" />
6464
<Compile Include="Overrides\Descriptors\ClearCacheDescriptorOverrides.cs" />
65+
<Compile Include="Overrides\Descriptors\ClearCachedRealmsDescriptorOverrides.cs" />
66+
<Compile Include="Overrides\Descriptors\ClearCachedRolesDescriptorOverrides.cs" />
6567
<Compile Include="Overrides\Descriptors\DeleteWarmerDescriptorOverrides.cs" />
68+
<Compile Include="Overrides\Descriptors\DescriptorOverridesBase.cs" />
6669
<Compile Include="Overrides\Descriptors\FieldStatsDescriptorOverrides.cs" />
70+
<Compile Include="Overrides\Descriptors\GraphExploreDescriptorOverrides.cs" />
6771
<Compile Include="Overrides\Descriptors\IDescriptorOverrides.cs" />
6872
<Compile Include="Overrides\Descriptors\IndicesStatsDescriptorOverrides.cs" />
6973
<Compile Include="Overrides\Descriptors\MultiTermVectorsDescriptorOverrides.cs" />
7074
<Compile Include="Overrides\Descriptors\NodesHotThreadsDescriptorOverrides.cs" />
7175
<Compile Include="Overrides\Descriptors\PutIndexTemplateDescriptorOverrides.cs" />
76+
<Compile Include="Overrides\Descriptors\ReindexRethrottleDescriptorOverrides.cs" />
7277
<Compile Include="Overrides\Descriptors\ScrollDescriptorOverrides.cs" />
7378
<Compile Include="Overrides\Descriptors\SearchDescriptorOverrides.cs" />
7479
<Compile Include="Overrides\Descriptors\ReindexOnServerDescriptorOverrides.cs" />
@@ -227,6 +232,7 @@
227232
<None Include="Views\_RequestParametersExtensions.Generated.cshtml" />
228233
<None Include="Views\_Requests.Generated.cshtml" />
229234
</ItemGroup>
235+
<ItemGroup />
230236
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
231237
<UsingTask TaskName="CopyRuntimeDependencies" AssemblyFile="..\..\..\.paket\paket.exe" />
232238
<Target Name="AfterBuild" Condition="Exists('..\..\..\.paket\paket.exe')">

src/CodeGeneration/ApiGenerator/CodeConfiguration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ private static string Root
3333
public static string EsNetFolder { get; } = $@"{Root}..\..\..\src\Elasticsearch.Net\";
3434
public static string ViewFolder { get; } = $@"{Root}Views\";
3535
public static string RestSpecificationFolder { get; } = $@"{Root}RestSpecification\";
36+
public static string LastDownloadedVersionFile { get; } = Path.Combine(Root, "last_downloaded_version.txt");
3637

3738
public static readonly Dictionary<string, string> MethodNameOverrides =
3839
(from f in new DirectoryInfo(NestFolder).GetFiles("*.cs", SearchOption.AllDirectories)

src/CodeGeneration/ApiGenerator/Domain/ApiEndpoint.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ public static void PatchMethod(CsharpMethod method)
320320
{
321321
skipList = overrides.SkipQueryStringParams ?? skipList;
322322
renameList = overrides.RenameQueryStringParams ?? renameList;
323+
324+
overrides.PatchMethod(method);
323325
}
324326
}
325327

0 commit comments

Comments
 (0)