It seems sensible to allow configuration of annotation introspector(s) to use with AvroModule, to allow for using Avro and/or Jackson introspectors. Although there are many ways to achieve this, it seems perhaps sensible to add three levels of configurability:
Default setting of just inserting AvroAnnotationIntrospector so that it has precedence, but defaults to whatever basic ObjectMapper (like AvroMapper) has otherwise configured. Usually this means "Avro annotations if present; otherwise Jackson" setting.
Allow explicit definition of introspector to register; if so, use that to replace whatever mapper has
Handle both (1) and (2) within an overridable method, called when module is being registered: for more complex cases this method may be just overridden by sub-classing AvroModule
It seems sensible to allow configuration of annotation introspector(s) to use with
AvroModule
, to allow for using Avro and/or Jackson introspectors. Although there are many ways to achieve this, it seems perhaps sensible to add three levels of configurability:AvroAnnotationIntrospector
so that it has precedence, but defaults to whatever basicObjectMapper
(likeAvroMapper
) has otherwise configured. Usually this means "Avro annotations if present; otherwise Jackson" setting.AvroModule