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

More Flexible subtype resolver #139

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

big-andy-coates
Copy link
Contributor

@big-andy-coates big-andy-coates commented Jan 25, 2021

Fixes: #137

Alternative to: #138

Note: built on top of #138 - sorry, being a bit lazy.

Rather than providing a callback, just move the actual code for resolving subtypes into the resolver itself. Then users are free to implement what they like here.

Obviously, it's their responsibility that this aligns with what ever weird and wonderful serialisation logic they have.

I've tried to make the change backwards compatible. Though I'm no Scala expert.

I think the introduction of the SubTypeResolver trait matches up well with the fix in #135, i.e. its no longer classes, but types, that are being resolved.

Personally, I prefer this pattern to #138.

…olving sub types.

Fixes: mbknor#137

Rather than providing a callback, just move the actual code for resolving subtypes into the resolver itself. Then users are free to implement what they like here.

Obviously, it's their responsibility that this aligns with what ever weird and wonderful serialization logic they have.
@big-andy-coates big-andy-coates changed the title Flexible resolver More Flexible subtype resolver Feb 4, 2021
@mbknor
Copy link
Owner

mbknor commented Feb 9, 2021

Thanks. This looks interesting. I'm looking into it..
I'm a little bit concerned that this change will not be dropin-compatible with old code..

@big-andy-coates
Copy link
Contributor Author

I think it should be, but haven't tried it. Definitely worth testing!

@big-andy-coates
Copy link
Contributor Author

Updated dependencies would also help me, if you're able #136

@big-andy-coates
Copy link
Contributor Author

Thoughts on this change @mbknor. Feel free to close the PR is you're not going to merge / adopt...

1 similar comment
@big-andy-coates
Copy link
Contributor Author

Thoughts on this change @mbknor. Feel free to close the PR is you're not going to merge / adopt...

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

Successfully merging this pull request may close these issues.

Provide callback to user code before trying to resolve @JsonTypeInfo types
2 participants