@Override
    public List<ResolvedType> findSubtypes(ResolvedType declaredType, SchemaGenerationContext context) {
        Schema annotation = declaredType.getErasedType().getAnnotation(Schema.class);
        if (annotation == null || (annotation.subTypes().length == 0 && annotation.anyOf().length == 0)) {
            return null;
        }
        TypeContext typeContext = context.getTypeContext();
        if (annotation.subTypes().length > 0) {
            return Stream.of(annotation.subTypes())
                    .map(erasedSubtype -> typeContext.resolveSubtype(declaredType, erasedSubtype))
                    .collect(Collectors.toList());
        }
        return Stream.of(annotation.anyOf())
                .map(typeContext::resolve)
                .collect(Collectors.toList());
    }
Subtype resolver considering {@code @Schema(subTypes = ...)} and as fall-back {@code @Schema(anyOf = ...)}.
jsonschema-module-swagger-2/src/main/java/com/github/victools/jsonschema/module/swagger2/Swagger2SubtypeResolver.java