Feature/inherited json identity info #946
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jackson serializes subclasses of classes annotated with
JsonIdentityInfo
as if the class itself were annotated withJsonIdentityInfo
. See the updates toObjectAsIdTest.testJackson
to prove this is the case. The TypeScript generator was not producing correct interface definitions because it was not properly recognizing allJsonIdentityInfo
cases.JsonIdentityInfo
isn'tInherited
, even if it wereClass.getAnnotation
doesn't return inherited annotations. We need to manually walk the target class upward looking forJsonIdentityInfo
.This PR adds an example of this problem to the test cases. First making the test cases pass with the current behavior. Next making the test cases fail using the expected behavior. Finally updating
Jackson2Parser
to make the tests pass.I simply added a utility method in
Jackson2Parser
to support this change. I see you have some utilities classes, but was unsure of your style for that. The method should be easy to move wherever you feel is best. Thanks.