Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API generator #4456

Merged
merged 1 commit into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/ApiGenerator/Configuration/CodeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public static class CodeConfiguration
"indices.reload_search_analyzers.json",
"rank_eval.json",
"eql.search.json",
"ml.delete_trained_model.json",
"ml.get_trained_models.json",
"ml.get_trained_models_stats.json",
"ml.put_trained_model.json",
"ml.explain_data_frame_analytics.json",

// Internal API,
"monitoring.bulk.json",
Expand Down
4 changes: 2 additions & 2 deletions src/ApiGenerator/Domain/RestApiSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public class RestApiSpec

public IDictionary<string, ApiEndpoint> Endpoints { get; set; }

public ImmutableSortedDictionary<string, ReadOnlyCollection<ApiEndpoint>> EndpointsPerNamespace =>
public ImmutableSortedDictionary<string, ReadOnlyCollection<ApiEndpoint>> EndpointsPerNamespaceLowLevel =>
Endpoints.Values.GroupBy(e=>e.CsharpNames.Namespace)
.ToImmutableSortedDictionary(kv => kv.Key, kv => kv.ToList().AsReadOnly());

public ImmutableSortedDictionary<string, ReadOnlyCollection<ApiEndpoint>> EndpointsPerNamespaceHighLevel =>
Endpoints.Values
.Where(v => !CodeConfiguration.IgnoredApisHighLevel.Contains(v.Name))
.Where(v => !CodeConfiguration.IgnoredApisHighLevel.Contains(v.FileName))
.GroupBy(e => e.CsharpNames.Namespace)
.ToImmutableSortedDictionary(kv => kv.Key, kv => kv.ToList().AsReadOnly());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar)
var target = GeneratorLocations.LowLevel($"ElasticLowLevelClient.{CsharpNames.RootNamespace}.cs");
await DoRazor(spec, view, target);

var namespaced = spec.EndpointsPerNamespaceHighLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList();
var namespaced = spec.EndpointsPerNamespaceLowLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList();
var namespacedView = ViewLocations.LowLevel("Client", "Implementation", "ElasticLowLevelClient.Namespace.cshtml");
await DoRazorDependantFiles(progressBar, namespaced, namespacedView, kv => kv.Key,
id => GeneratorLocations.LowLevel($"ElasticLowLevelClient.{id}.cs"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar)
var view = ViewLocations.LowLevel("RequestParameters", "RequestParameters.cshtml");
string Target(string id) => GeneratorLocations.LowLevel("Api", "RequestParameters", $"RequestParameters.{id}.cs");

var namespaced = spec.EndpointsPerNamespaceHighLevel.ToList();
var namespaced = spec.EndpointsPerNamespaceLowLevel.ToList();
await DoRazorDependantFiles(progressBar, namespaced, view, kv => kv.Key, id => Target(id));
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/ApiGenerator/RestSpecification/Core/delete_by_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
]
},
"params":{
"analyzer": {
"type" : "string",
"description" : "The analyzer to use for the query string"
},
"analyze_wildcard": {
"type" : "boolean",
"description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)"
Expand Down
5 changes: 5 additions & 0 deletions src/ApiGenerator/RestSpecification/Core/msearch_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
"type" : "boolean",
"description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response",
"default" : false
},
"ccs_minimize_roundtrips": {
"type" : "boolean",
"description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution",
"default" : "true"
}
},
"body":{
Expand Down
80 changes: 45 additions & 35 deletions src/ApiGenerator/RestSpecification/Core/root.html

Large diffs are not rendered by default.

This file was deleted.

5 changes: 5 additions & 0 deletions src/ApiGenerator/RestSpecification/Core/search_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
"type":"boolean",
"description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response",
"default":false
},
"ccs_minimize_roundtrips": {
"type" : "boolean",
"description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution",
"default" : "true"
}
},
"body":{
Expand Down
72 changes: 0 additions & 72 deletions src/ApiGenerator/RestSpecification/XPack/cat.ml.datafeeds.json

This file was deleted.

89 changes: 0 additions & 89 deletions src/ApiGenerator/RestSpecification/XPack/cat.ml.jobs.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ccr.forget_follower":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html"
"url":"http://www.elastic.co/guide/en/elasticsearch/reference/current"
},
"stability":"stable",
"url":{
Expand Down
2 changes: 1 addition & 1 deletion src/ApiGenerator/RestSpecification/XPack/ccr.unfollow.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ccr.unfollow":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html"
"url":"http://www.elastic.co/guide/en/elasticsearch/reference/current"
},
"stability":"stable",
"url":{
Expand Down

This file was deleted.

This file was deleted.

Loading