Skip to content

Commit d2e9333

Browse files
authored
Ignore ContainsMetadata field when automapping Attachment (#4789)
This commit adds [Ignore] attribute to the ContainsMetadata field to ignore the field when automapping an Attachment. [IgnoreDataMember] ignores the value when serializing an instance of Attachment, but NoopPropertyVisitor does not take into account [IgnoreDataMember] when mapping properties.
1 parent 1467939 commit d2e9333

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/Nest/Mapping/Types/Specialized/Attachment/Attachment.cs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class Attachment
2929
/// attachment.
3030
/// </summary>
3131
[IgnoreDataMember]
32+
[Ignore]
3233
public bool ContainsMetadata =>
3334
!Author.IsNullOrEmpty() ||
3435
ContentLength.HasValue ||

src/Nest/Mapping/Visitor/NoopPropertyVisitor.cs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Nest
88
{
9+
// TODO: Make all methods virtual
910
public class NoopPropertyVisitor : IPropertyVisitor
1011
{
1112
public virtual bool SkipProperty(PropertyInfo propertyInfo, ElasticsearchPropertyAttributeBase attribute) => false;

0 commit comments

Comments
 (0)