I was looking to create a helidon-http-media library such that classes could be used directly with the helidon WebClient. I think I need to have a way to identify if a class is deserializable by this library (i.e. if a JsonAdapter has been registered for it). I've not been able to find a way to do that lookup without attempting to perform the serialization and catching an exception.
Right now it appears I must attempt to serialize/deserialize things and catch the exception to identify if serialization/deserialization is possible.
try {
JsonAdapter<MyClass> adapter = jsonb.adapter(MyClass.class);
// adapter exists, can use jsonb
} catch (IllegalArgumentException e) {
// no adapter found, use alternative approach
}