-
-
Notifications
You must be signed in to change notification settings - Fork 149
[Ion] Better support for Ion type annotations. #109
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
Conversation
Re-implemented an IonAnnotationTypeResolverBuilder which allows the use for standard Jackson type annotations. This also removes the need for a custom module. See JsonTypeInfoAnnotationsTest for example usage and configurations.
|
Quick question: would this make sense to be automatically registered by Second question: I'd be happy to merge this, but need to make sure we have CLA that covers the contribution. We have one corporate one that might apply; but if not, we'd need CLA (either personal or CCLA): https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf and usual way is to print, fill & sign, scan, send to |
|
Maybe, but I am not sure I understand the impact of what the registration would do. Is the suggestion to have something like I believe the corporate one should suffice (?) as I am porting changes made internally out to this project (not my own changes developed outside of the company). What situations would the existing corporate one not cover that the CLA would (or vice versa) |
|
Ah wrt CLA we are good. I forgot this was handled earlier (github doesn't make it super easy to keep some aspect connected, and I try to respect privacy of contributors). So existing cla is fine, I just forgot it had been updated. On type resolver... yeah. I may need to think about this a bit. I definitely would NOT want to enable default typing as baseline, as it is potential security hole. At the same time would be nice not to require users to explicitly register handlers. |
|
Just checking back and seeing if you had any insight on he resolver bit? I feel like I don't know enough to suggest a path forward but curious if you had any thoughts. |
|
Ok. Looking at this again, I think there are multiple things I am not happy about, much from perspective of how difficult this aspect is to override. So, from Jackson API/usage, there are 2 quite distinct mechanisms:
It would be great if the two were more integrated, and there was good override mechanism. As to proposed solution, I just think it'd be great not to require user to annotation resolver builder, since that should be provided by Due to dualism, I think that use of Ion-specific Does this make more sense? I have been (and am) bit time-crunched and lacking forcus with Jackson components, so apologies for slow response rate and high latency. |
|
Sorry about this late reply. I was out for a while between getting sick and vacation. I am open to your suggestion of allowing this to be more or less default behavior of the IonObjectMapper, it seems to make a lot of sense for this to be easier to enable by default. I like the idea of this being set in a module that can be registered by the mapper. I have tried some experimenting but I don't think I quite understand how to enable this. I am not seeing the methods in a module to enable this kind of behavior. I also tried playing around in the Mapper constructor itself to change the default typing ( Any suggestions on how this should be implemented? |
|
@mcliedtke I don't know to be honest. Another challenge we'll have is that 3.0 will change the way modules interact with mapper quite a bit, if (and probably when) I'll make |
|
I think this is obsolete, closing -- if not, may be reopened. |
Better support for Ion type annotations.
Re-implemented an IonAnnotationTypeResolverBuilder which allows the use for standard Jackson type annotations. This also removes the need for a custom module.
See JsonTypeInfoAnnotationsTest for example usage and configurations.