Open big-andy-coates opened 3 years ago
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..
I think it should be, but haven't tried it. Definitely worth testing!
Updated dependencies would also help me, if you're able https://github.com/mbknor/mbknor-jackson-jsonSchema/pull/136
Thoughts on this change @mbknor. Feel free to close the PR is you're not going to merge / adopt...
Thoughts on this change @mbknor. Feel free to close the PR is you're not going to merge / adopt...
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.