I did try the JsonClassDiscriminator annotation and sadly notice it's work fine, but one way only (decoding).
When it's time to 'encode' a json string into your data class, if one of its properties is the one you put into 'JsoClassDiscriminator' (which is very likely to be) the encode will fail
Personally I had write my own serializable to be able to both decode/encode