-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
UnmatchedFieldTypeModule prevents certain jackson features from working #6342
Comments
Changes the delegation in SettableBeanPropertyDelegate from a custom implementation to the standard way of implementing a delegating property in jackson. This way, if some jackson module overrides methods that are not delegated explicitely here, they will continue to work. Fixes: fabric8io#6342
Changes the delegation in SettableBeanPropertyDelegate from a custom implementation to the standard way of implementing a delegating property in jackson. This way, if some jackson module overrides methods that are not delegated explicitely here, they will continue to work. Fixes: fabric8io#6342
Created a PR that changes to |
Hi @fxshlein, Sorry for the late reply. The core team had a face to face meeting during last week and we were swamped with meetings. Thanks for looking into this and for your pull request.
I implemented the problematic module and I'm not sure why I overlooked so many things (the existing delegator superclass + missing implementation overrides). Let me dig a little deeper to see if there's some other reasoning behind this before I merge your fix. |
No worries, hope the meetings were enjoyable!
To be fair, it's jackson... it has every feature imaginable, but sometimes discovering them is as hard as just writing them from scratch in the first place 😄 |
This has come up before #5028 and we raised an upstream issue on some of the design issues FasterXML/jackson-databind#3862 - which confirmed we're basically stuck with a problem for a while. If it crept in this time via an upgrade we can consider something like adding a unit test to look for the declared method count on the base class to capture an approved number of methods - if it changes with an upgrade of Jackson someone will have to review the new methods to see if new logic is required before updating the expected method count. |
Yeah, sadly the writer doesn't seem to have any delegation mechanism, only |
Changes the delegation in SettableBeanPropertyDelegate from a custom implementation to the standard way of implementing a delegating property in jackson. This way, if some jackson module overrides methods that are not delegated explicitely here, they will continue to work. Fixes: fabric8io#6342
I added a few extra-commits to #6343
With these changes, I think we should be safe from any future issue related to this component. |
…n (6343) fix(model): Use SettableBeanProperty.Delegating for jackson delegation Changes the delegation in SettableBeanPropertyDelegate from a custom implementation to the standard way of implementing a delegating property in jackson. This way, if some jackson module overrides methods that are not delegated explicitely here, they will continue to work. Fixes: #6342 --- fix: SettableBeanProperty.deserializeSetAndReturn should return instance instead of null Signed-off-by: Marc Nuri <marc@marcnuri.com> --- test:refactor: SettableBeanPropertyDelegateTest doesn't rely on mocks Signed-off-by: Marc Nuri <marc@marcnuri.com> --- fix: SettableBeanPropertyDelegate implements all methods from SettableBeanProperty Includes tests to ensure all methods are implemented in future Jackson versions too. Signed-off-by: Marc Nuri <marc@marcnuri.com> Co-authored-by: Marc Nuri <marc@marcnuri.com> Signed-off-by: Marc Nuri <marc@marcnuri.com>
Describe the bug
I'm using the jackson-module-kotlin, registered in
KubernetesSerialization
. When deserializing a kotlin object, theSettableBeanPropertyDelegate
that is added here does not properly delegate some functions from jackson (in this case,getCreatorIndex()
). These are implemented with a default value by jackson, but they can be overridden by special properties, like kotlin constructor properties.Fabric8 Kubernetes Client version
6.13.3
Steps to reproduce
Expected behavior
I think this is a simple oversight, and the delegate is probably supposed implement and delegate all the functions.
Runtime
other (please specify in additional context)
Kubernetes API Server version
other (please specify in additional context)
Environment
other (please specify in additional context)
Fabric8 Kubernetes Client Logs
Additional context
This is happening anywhere and is not really platform-dependent.
Jackson provides
SettableBeanProperty.Delegating
for reliably delegating all properties, and using it as a supertype I fixed the issue (although registering this was a bit hacky). The delegate I'm using instead of SettableBeanPropertyDelegate looks like this:The text was updated successfully, but these errors were encountered: