mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 15:17:30 -04:00
Bump compatible rest api version to 9/8 (#113151)
This commit bumps the REST API version from 8 to 9. This effectively removes all support for REST API compatibility with version 7 (though earlier commits already chipped away at some v7 support). This also enables REST API compatibility support for version 8, providing support for v8 compatibility headers, i.e. "application/vnd.elasticsearch+json;compatible-with=8" and no-op support (no errors) to accept v9 compatibility headers i.e. "application/vnd.elasticsearch+json;compatible-with=9". see additional context in the GH PR #113151
This commit is contained in:
parent
1b5d75f537
commit
888188695a
52 changed files with 298 additions and 1520 deletions
|
@ -22,14 +22,13 @@ public enum RestApiVersion {
|
|||
|
||||
V_8(8),
|
||||
|
||||
@UpdateForV9 // remove all references to V_7 then delete this annotation
|
||||
V_7(7);
|
||||
|
||||
public final byte major;
|
||||
|
||||
@UpdateForV9
|
||||
// We need to bump current and previous to V_9 and V_8, respectively
|
||||
private static final RestApiVersion CURRENT = V_8;
|
||||
private static final RestApiVersion PREVIOUS = V_7;
|
||||
private static final RestApiVersion CURRENT = V_9;
|
||||
private static final RestApiVersion PREVIOUS = V_8;
|
||||
|
||||
RestApiVersion(int major) {
|
||||
this.major = (byte) major;
|
||||
|
@ -67,8 +66,6 @@ public enum RestApiVersion {
|
|||
};
|
||||
}
|
||||
|
||||
@UpdateForV9
|
||||
// Right now we return api version 8 for major version 9 until we bump the api version above
|
||||
public static RestApiVersion forMajor(int major) {
|
||||
switch (major) {
|
||||
case 7 -> {
|
||||
|
@ -78,7 +75,7 @@ public enum RestApiVersion {
|
|||
return V_8;
|
||||
}
|
||||
case 9 -> {
|
||||
return V_8;
|
||||
return V_9;
|
||||
}
|
||||
default -> throw new IllegalArgumentException("Unknown REST API version " + major);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue