fix AnnotatedCompositeSerializer so it can handle generics