Hi all, I’m currently working on implementing JSON-B 3 polymorphism. See https://github.com/jungm/johnzon/tree/jsonb3-polymorphism, still WIP as I need to write tests + documentation and remove johnzon-jsonb-extras. But it’s passing all TCK polymorphism tests except for one as of right now (And that last one is probably related to locale validation in johnzon).
I couldn’t really implement this on top of the current way polymorphism works in johnzon-mapper because it expects that JSONs will always only contain one property to describe it’s type vs the JSON-B 3 spec having multiple properties to describe the type. As of now I have created a default polymorphism implementation that seamlessly mimics the way polymorphism used to work before in johnzon-mapper to avoid breaking changes for users, but this approach creates some redundancies in MapperBuilder. Ideally I’d like to completely remove this old polymorphism code also from MapperBuilder and create some sort of PolymorphismBuilder that could be used instead and plugged into MapperBuilder. But this will obviously break the API for anyone using johonzon-mapper directly with polymorphism. Any thoughts on this? Thanks Markus