There are some behaviour differences in JSON payload type handling:
(A) JSONMarshaller.marshall() produces type with FQCN.
This is properly unmarshalled by JSONMarshaller.unmarshall(). And we can consider that this is the standard payload.
(B) Then, if we edit the above payload to use "simple class name" by removing packages,
This is not properly unmarshalled. pojo1's fields are populated but pojo2's fields become 'null'.
(C) Btw, if we have a type (of "simple class name") only for a top level object,
This is properly unmarshalled by JSONMarshaller.unmarshall().
So I conclude that "simple class name" works only for a top level object now.
The "simple class name" is handled by this part of JSONMarshaller$CustomObjectDeserializer.mapObject()
because JSONMarshaller$CustomObjectDeserializer.classes contains simple class names:
However, the mapObject() is called only for top level objects so nested objects are not properly handled.
I confirmed with Enrique that (A) is correct and (B) is not. (C) is for convenience.
So we don't take the behaviour difference as a bug. In other words, users should use (A) approach.
Enrique noted that he can provide a more uniform way to handle this. So I filed this JIRA.
FYI) You may use unit tests in this draft PR if useful: