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

Add method ObjectWriter.forBaseType(class/JavaType) for tricky polymorphic cases #789

Closed
cowtowncoder opened this issue May 12, 2015 · 2 comments
Labels
duplicate Duplicate of an existing (usually earlier) issue

Comments

@cowtowncoder
Copy link
Member

Currently forcing of type information for ObjectWriter only allows specifying both implementation type to use (for locating JsonSerializer) AND "base type" used by TypeSerializer. Since behavior varies between the two, there are cases where one would want to use different type, to specifically force use of a particular base type to produce type id(s) desired.

As far as I can see, this is only needed on writer (serialization) side: during deserialization, there is no distinction between actual runtime type (of an instance) and base type, and a single type works for both.

@cowtowncoder
Copy link
Member Author

I started implementation for this one, but after a while realized that I don't actually know the expected use. About the only case I can think of it could solve is related to using default typing, and forcing base type to be, say, java.lang.Object. But I suspect there should be other use cases for handling things like Collections and Maps. If so, however, use case is needed to have tests to verify feature actually works as intended, and solves the problem.
So this can wait at least until 2.7 at this point.

@cowtowncoder
Copy link
Member Author

Close this, reopen #1093.

@cowtowncoder cowtowncoder added duplicate Duplicate of an existing (usually earlier) issue and removed 2.10 labels Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicate of an existing (usually earlier) issue
Projects
None yet
Development

No branches or pull requests

1 participant