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

UnrecognizedPropertyException in 2.7.1 for properties that work with version 2.6.5 #1128

Closed
Roleek opened this issue Feb 12, 2016 · 4 comments
Milestone

Comments

@Roleek
Copy link

Roleek commented Feb 12, 2016

The attached test case works fine with version 2.6.5 but it produces com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "id" with version 3.7.1.
QuickTestJacksonIssue.zip

@cowtowncoder
Copy link
Member

Thank you for reporting this, providing test case.

@cowtowncoder
Copy link
Member

Ah-ha. Looks like self-referential recursive type (ResolvedRecursiveType) is part of the problem here.
Not yet sure how, but seems to be the type that is missing properties.

@cowtowncoder
Copy link
Member

Fixed part of the problem, so that id field is handled. Remaining issue with field p1 seems like something that should be resolvable; but it also appears to not fail only if p1 is suppressed during serialization; if value is not 0, for example, it fails with 2.6. as well.

@cowtowncoder
Copy link
Member

Actually, looking through the example with more thought, I realize that code now does work: the issue is with class definition. Field parent can not be resolved to anything higher than DevBase due to declaration of:

class DevBase extends HObj<DevBase>

during deserialization; but during serialization, actual type of parent is DevM. To solve that, either type parameterization would have to be carried through class hierarchy (if possible), or, polymorphic handling should be enabled for HObj (or perhaps DevBase).
Anyway, I think fix is actually complete here.

@cowtowncoder cowtowncoder added this to the 2.7.2 milestone Feb 26, 2016
cowtowncoder added a commit that referenced this issue Feb 26, 2016
…ds to make type handling correct in test 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

2 participants