Skip to content

Commit 0271262

Browse files
committed
Fix #1821 AutoMap on PutMappingDescriptor ignored maxRecursion
1 parent 415ff78 commit 0271262

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public PutMappingDescriptor(IndexName index, TypeName type) : base(r=>r.Required
138138
public PutMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int maxRecursion = 0) => Assign(a =>
139139
{
140140
a.Properties = a.Properties ?? new Properties();
141-
var autoProperties = new PropertyWalker(typeof(T), visitor).GetProperties();
141+
var autoProperties = new PropertyWalker(typeof(T), visitor, maxRecursion).GetProperties();
142142
foreach (var autoProperty in (IEnumerable<KeyValuePair<PropertyName, IProperty>>)autoProperties)
143143
a.Properties[autoProperty.Key] = autoProperty.Value;
144144
});

src/Nest/Mapping/Visitor/PropertyWalker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class PropertyWalker
1212
private readonly int _maxRecursion;
1313
private readonly ConcurrentDictionary<Type, int> _seenTypes;
1414

15-
public PropertyWalker(Type type, IPropertyVisitor visitor, int maxRecursion = 0)
15+
public PropertyWalker(Type type, IPropertyVisitor visitor, int maxRecursion)
1616
{
1717
_type = GetUnderlyingType(type);
1818
_visitor = visitor ?? new NoopPropertyVisitor();

0 commit comments

Comments
 (0)