Skip to content

Stackoverflow when mapping using NEST #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sljohtmboe opened this issue Jun 13, 2014 · 1 comment
Closed

Stackoverflow when mapping using NEST #713

sljohtmboe opened this issue Jun 13, 2014 · 1 comment
Assignees
Milestone

Comments

@sljohtmboe
Copy link

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).

@gmarz
Copy link
Contributor

gmarz commented Jun 19, 2014

@sljohtmboe thanks for finding this and creating a test to reproduce 👍. The issue was that we were adding the collection type to seenTypes instead of the underlying type itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants