Skip to content
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

Fix for polymorphic custom map key serializer #827

Closed
wants to merge 1 commit into from

Conversation

mjr6140
Copy link

@mjr6140 mjr6140 commented Jun 12, 2015

When using ObjectMapper.DefaultTyping.NON_FINAL with a non-final map key
and custom map key serializer the serializer is being ignored and
instead the default serializer is always called.

See test case for a minimal example of the issue. It looks like this issue appeared
starting with 2.5.0 but worked correctly in previous versions.

When using ObjectMapper.DefaultTyping.NON_FINAL with a non-final map key
and custom map key serializer the serializer is being ignored and
instead the default serializer is always called.
@cowtowncoder
Copy link
Member

Sounds plausible. I may need to backport this into 2.5 branch if so.

@cowtowncoder
Copy link
Member

I hope you don't mind if I actually include test first, for 2.5; may do manual merge here.

cowtowncoder added a commit that referenced this pull request Jun 12, 2015
cowtowncoder added a commit that referenced this pull request Jun 12, 2015
@cowtowncoder
Copy link
Member

Ok: I made one minor change to serializer accessor, since I think it should not try wrapping with type serializer, but otherwise fixed as suggested.
But unlike my earlier plan, I did not backport fix in 2.5.x yet. My concern is that with JAX-RS it could lead to issues (there are a few damned-if-you-damned-if-you-dont dilemmas) so I'd rather go with 2.6 route.

I also really need to figure out the distinction between "root serialization type" and "root base type for polymorphic serialization", but one step at a time.

Thank you for reporting this and pointing out the fix!

@cowtowncoder cowtowncoder added this to the 2.6.0-rc3 milestone Jun 13, 2015
cowtowncoder added a commit that referenced this pull request Jun 13, 2015
@mjr6140
Copy link
Author

mjr6140 commented Jun 15, 2015

Thanks for taking a look at this! I just re-tested and this is working as expected now in master.

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

Successfully merging this pull request may close these issues.

None yet

2 participants