Jackson supports @JsonTypeInfo on interfaces, not just classes. If use is set to anything other than Id.Type then currently the generator invokes ClassGraph to find the the subtypes of the type. However, ClassGraph has different methods for finding implementations of an interface vs subtypes of a class: getClassesImplementing vs getSubclasses respectively.
This change enhances the generator to call getClassesImplementing when the type annotated with @JsonTypeInfo is an interface.
fixes: https://github.com/mbknor/mbknor-jackson-jsonSchema/issues/134
Jackson supports
@JsonTypeInfo
on interfaces, not just classes. Ifuse
is set to anything other thanId.Type
then currently the generator invokesClassGraph
to find the the subtypes of the type. However,ClassGraph
has different methods for finding implementations of an interface vs subtypes of a class:getClassesImplementing
vsgetSubclasses
respectively.This change enhances the generator to call
getClassesImplementing
when the type annotated with@JsonTypeInfo
is an interface.