Skip to content

Commit e45282c

Browse files
authored
Fix/bwc obsolete (#3739)
* Indent global.json * Patch in ctors and methods needed for binary compatibility This commit patches in ctors and methods that are removed between 6.6.0 and 6.7.0 rest api specs, and marks then as obsolete
1 parent 3f1b7f2 commit e45282c

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

build/scripts/Versioning.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module Versioning =
2929
let writeVersionIntoGlobalJson version =
3030
let globalJson = globalJson ()
3131
let newGlobalJson = { globalJson with version = version.ToString(); }
32-
File.WriteAllText("global.json", JsonConvert.SerializeObject(newGlobalJson))
32+
File.WriteAllText("global.json", JsonConvert.SerializeObject(newGlobalJson, Formatting.Indented))
3333
printfn "Written (%s) to global.json as the current version will use this version from now on as current in the build" (version.ToString())
3434

3535
let GlobalJsonVersion = parse <| globalJson().version

src/Nest/Indices/MappingManagement/PutMapping/PutMappingRequest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ public PutMappingRequest() : this(typeof(T), typeof(T)) { }
101101
[DescriptorFor("IndicesPutMapping")]
102102
public partial class PutMappingDescriptor<T> where T : class
103103
{
104+
/// <summary>/{index}/{type}/_mapping. Will infer the index from the generic type</summary>
105+
///<param name="type"> this parameter is required</param>
106+
public PutMappingDescriptor(TypeName type) : base(r=>r.Required("type", type).Required("index", (IndexName)typeof(T))){}
107+
104108
public PutMappingDescriptor(IndexName index, TypeName type) : base(r => r.Required("index", index).Required("type", type)) { }
105109

106110
IAllField ITypeMapping.AllField { get; set; }
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
namespace Nest
1+
using System;
2+
3+
namespace Nest
24
{
35
public partial interface IDisableUserRequest { }
46

57
public partial class DisableUserRequest { }
68

79
[DescriptorFor("XpackSecurityDisableUser")]
8-
public partial class DisableUserDescriptor { }
10+
public partial class DisableUserDescriptor
11+
{
12+
[Obsolete("Use the constructor that accepts Name. Will be removed in the next major release")]
13+
public DisableUserDescriptor() { }
14+
15+
[Obsolete("Use the constructor that accepts Name. Will be removed in the next major release")]
16+
public DisableUserDescriptor Username(Name username) =>
17+
Assign(username, (a , v) => a.RouteValues.Required("username", username));
18+
}
919
}
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
namespace Nest
1+
using System;
2+
3+
namespace Nest
24
{
35
public partial interface IEnableUserRequest { }
46

57
public partial class EnableUserRequest { }
68

79
[DescriptorFor("XpackSecurityEnableUser")]
8-
public partial class EnableUserDescriptor { }
10+
public partial class EnableUserDescriptor
11+
{
12+
[Obsolete("Use the constructor that accepts Name. Will be removed in the next major release")]
13+
public EnableUserDescriptor() { }
14+
15+
[Obsolete("Use the constructor that accepts Name. Will be removed in the next major release")]
16+
public EnableUserDescriptor Username(Name username) =>
17+
Assign(username, (a , v) => a.RouteValues.Required("username", username));
18+
}
919
}

0 commit comments

Comments
 (0)