Deserialisation of JSON object with polymorphic property type

Hi folks,

I got stuck in deserialisation of a JSON object.

This (root) object has a property named "foo", that can either be a string or another JSON object:

{ "foo" : "Some string" } or { "foo" : { "bar" : 123 } }

Any ideas how to represent this in Java?

Notes: - This is an public 3rd party API => I cannot modify the API. - I am using Jackson lib (fasterxml) for dealing with JSON.

Thanks in advance