One method is to register alternative deserializers for String, Integer, and Long, which inspect the JSON type of the current token and refuse to deserialize a mismatched one. This works -- my implementation uses exception generation but I think it might be possible to get it to work with
The other method is to just deserialize to a
and then inspect the type that Jackson picked.
Maybe I need to play with
a bit, I see the docs say they're similar to Jackson modules. Would still prefer to create a
that can be resolved by the plugin at compile time if possible though.