private void traverseGenericType(ObjectNode targetNode, GenericTypeDetails typeDetails) {
        ResolvedType targetType = typeDetails.getScope().getType();
        if (shouldAddReferenceForExistingDefinition(typeDetails)) {
            logger.debug("adding reference to existing definition of {}", targetType);
            this.addReference(targetType, targetNode, typeDetails.getIgnoredDefinitionProvider(), typeDetails.isNullable());
            // nothing more to be done
            return;
        }
        final Map.Entry<ObjectNode, Boolean> definitionAndTypeAttributeInclusionFlag;
        final CustomDefinition customDefinition = this.generatorConfig.getCustomDefinition(targetType, this,
                typeDetails.getIgnoredDefinitionProvider());
        if (customDefinition == null) {
            // always inline array types
            GenericTypeDetails typeDetailsWithInlineArrays = typeDetails.withAlternativeReasonToInline(
                    this.typeContext.isContainerType(targetType) && targetNode != null);
            definitionAndTypeAttributeInclusionFlag = this.applyStandardDefinition(targetNode, typeDetailsWithInlineArrays);
        } else {
            GenericTypeDetails typeDetailsWithCustomPreference = typeDetails.withAlternativeReasonToInline(customDefinition.isMeantToBeInline());
            definitionAndTypeAttributeInclusionFlag = this.applyCustomDefinition(customDefinition, targetNode, typeDetailsWithCustomPreference);
        }
        final ObjectNode definition = definitionAndTypeAttributeInclusionFlag.getKey();
        if (definitionAndTypeAttributeInclusionFlag.getValue()) {
            Set<String> allowedSchemaTypes = this.collectAllowedSchemaTypes(definition);
            ObjectNode typeAttributes = AttributeCollector.collectTypeAttributes(typeDetails.getScope(), this, allowedSchemaTypes);
            // ensure no existing attributes in the 'definition' are replaced, by way of first overriding any conflicts the other way around
            typeAttributes.setAll(definition);
            // apply merged attributes
            definition.setAll(typeAttributes);
        }
        // apply overrides as the very last step
        this.generatorConfig.getTypeAttributeOverrides()
                .forEach(override -> override.overrideTypeAttributes(definition, typeDetails.getScope(), this));
    }
Preparation Step: add the given target type. Also catering for forced inline-definitions and ignoring custom definitions.

@param targetNode node in the JSON schema that should represent the targetType
@param typeDetails details of the target type to generate subschema for
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/SchemaGenerationContextImpl.java