Skip to content

Stackoverflow when mapping using NEST #713

@sljohtmboe

Description

@sljohtmboe

I'm encountering a stackoverflow when using NEST to map classes which contain an IEnumerable of the same class.

I've created a test which fails demonstrating the problem.

The problem appears to be in the WriteProperties method (in Nest.Resolvers.Writers.TypeMappingWriter.cs). The deepType is added to the dictionary of seenTypes, however when newTypeMappingWriter is created using the internal constructor it's _type member is set to the result of GetUnderlyingType(deepType) the _type member is then used to check the seenTypes which returns 0 as the underlying type (in the case of an array or a generic) never make it into seenTypes.

I've reproduced the error in 1.0.0-beta1 and latest master (9612928).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions