Re: Partial JSON deserialization

Andy Guibert

I think you can still achieve what you need with an adapter, consider this JSON data:

  type: "com.Foo"
  data: {
    value: "Hello"

in your adapter, you check the type, then depending on the type you can use Jsonb#fromJson(String, Class<?>) to get a POJO of the correct target class.  So something like:
  return jsonb.fromJson(map.get("data"), Foo.class);

Or more generically you can verify the type is an "allowed type" and then use reflection after that point so you don't end up with a bunch of `if` statements

Your use case seems to be spot on for this unit test over in Yasson:

Join to automatically receive all group messages.