-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(java): remove Jackson confusion with certain patterns
(Reintroduce #987). Upon deserializing (`ObjectMapper#treeToValue`), Jackson will first validate the `valueType` for whether ti can be deserialized with the "standard" bean deserializer. This will bail out if there are multiple ambiguous setters for a given property (they are ambiguous if they have parameters of non-trivial types, such as `List`, some class, ...). In order to remove the problem, this changes the deserialization path so that instead of asking for deserialization into the needed instance type directly, `JsiiObject` will be requested instead when the declared type is a sub-class of that. Since such types are passed by-reference, the custom de-serializer modifier will correctly determine the "right" class to use (the declared type, or a subtype of it), and return this... But Jackson will not get the chance to be confused or unhappy about that type's structure. This was the root cause of aws/aws-cdk#4080
- Loading branch information
1 parent
bc27018
commit 87c51aa
Showing
17 changed files
with
770 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.