-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update REST API specs to v7.4.0 #4117
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
Conversation
This commit changes the in memory structure of the ApiEndpoint in 7.4.0 to the old structure expected by the ApiGenerator.
This commit updates the REST API specs to those in the v7.4.0 branch, and re-runs the ApiGenerator. New 7.4.0 APIs are excluded from code generation for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this LGTM, love the pragramatic approach to support the new format. Couple a breaking changes came through this update though.
@@ -41,7 +42,15 @@ public static class CodeConfiguration | |||
// these APIs are new and need to be mapped | |||
"ml.set_upgrade_mode.json", | |||
"ml.find_file_structure.json", | |||
"monitoring.bulk.json" | |||
"monitoring.bulk.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat related to this, I think we should start letting these generate methods on the low level client and only use this list to block high level generation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can follow up in a separate PR for this
/// <summary> | ||
/// Changes the structure of new REST API spec in 7.4.0 to one that matches prior spec structure. | ||
/// </summary> | ||
private static void TransformNewSpecStructureToOld(JObject original) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the right approach on our 7.x branch, in master we might need to look in to moving our in memory representation over as well. This can be forward ported to master in the mean time.
Love the pragmatic solution though 👍
@@ -361,13 +361,6 @@ public class DeleteByQueryRequestParameters : RequestParameters<DeleteByQueryReq | |||
set => Q("analyze_wildcard", value); | |||
} | |||
|
|||
///<summary>The analyzer to use for the query string</summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, looks like it was removed from the spec:
src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs
Outdated
Show resolved
Hide resolved
src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.NoNamespace.cs
Outdated
Show resolved
Hide resolved
This commit patches the breaking changes in the 7.4.0 REST API specs for: - delete_by_query - msearch_template - search_template
"slm.delete_lifecycle.json", | ||
"slm.execute_lifecycle.json", | ||
"slm.get_lifecycle.json", | ||
"slm.put_lifecycle.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are marked as stable, so should be implemented in the 7.4 release (OK to be ignored for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, they're stable but don't want to conflate generating implementations for them in this PR 🙂
{ | ||
public static class ApiEndpointFactory | ||
{ | ||
public static ApiEndpoint FromFile(string jsonFile) | ||
{ | ||
var officialJsonSpec = JObject.Parse(File.ReadAllText(jsonFile)); | ||
TransformNewSpecStructureToOld(officialJsonSpec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, agree about the schema transform that Martijn highlighted - keep it as-is for now and look to improve later down the track.
* Transform REST API spec to existing format This commit changes the in memory structure of the ApiEndpoint in 7.4.0 to the old structure expected by the ApiGenerator. * Update specs to v7.4.0 This commit updates the REST API specs to those in the v7.4.0 branch, and re-runs the ApiGenerator. New 7.4.0 APIs are excluded from code generation for now. * Patch 7.4.0 breaking changes - delete_by_query - msearch_template - search_template (cherry picked from commit 6da223b)
ported to master |
Update the REST API specs to those in the v7.4.0 branch, and re-run the ApiGenerator. New 7.4.0 APIs are excluded from code generation for now.
Update in memory structure of the ApiEndpoint in 7.4.0 to the old structure expected by the ApiGenerator.