private ObjectNode createSubtypeDefinition(TypeScope scope, JsonTypeInfo typeInfoAnnotation, JsonSubTypes subTypesAnnotation,
            SchemaGenerationContext context) {
        ResolvedType javaType = scope.getType();
        final String typeIdentifier = this.getTypeIdentifier(javaType, typeInfoAnnotation, subTypesAnnotation);
        if (typeIdentifier == null) {
            return null;
        }
        ObjectNode attributesToInclude = this.getAttributesToInclude(scope, context);
        final ObjectNode definition = context.getGeneratorConfig().createObjectNode();
        SubtypeDefinitionDetails subtypeDetails = new SubtypeDefinitionDetails(javaType, attributesToInclude, context, typeIdentifier, definition);
        switch (typeInfoAnnotation.include()) {
        case WRAPPER_ARRAY:
            createSubtypeDefinitionForWrapperArrayTypeInfo(subtypeDetails);
            break;
        case WRAPPER_OBJECT:
            this.createSubtypeDefinitionForWrapperObjectTypeInfo(subtypeDetails);
            break;
        case PROPERTY:
        case EXISTING_PROPERTY:
            this.createSubtypeDefinitionForPropertyTypeInfo(subtypeDetails, typeInfoAnnotation);
            break;
        default:
            return null;
        }
        return definition;
    }
Create the custom schema definition for the given subtype, considering the {@link JsonTypeInfo#include()} setting.

@param scope targeted subtype
@param typeInfoAnnotation annotation for looking up the type identifier and determining the kind of inclusion/serialization
@param subTypesAnnotation annotation specifying the mapping from super to subtypes (potentially including the discriminator values)
@param context generation context
@return created custom definition (or {@code null} if no supported subtype resolution scenario could be detected
jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JsonSubTypesResolver.java