private static boolean canExtendTypeDeclarationToIncludeNull(ObjectNode node, SchemaGeneratorConfig config) {
        if (config.shouldAlwaysWrapNullSchemaInAnyOf()) {
            return false;
        }
        Stream<SchemaKeyword> requiringAnyOfWrapper = Stream.of(
                SchemaKeyword.TAG_REF, SchemaKeyword.TAG_ALLOF, SchemaKeyword.TAG_ANYOF, SchemaKeyword.TAG_ONEOF,
                // since version 4.21.0
                SchemaKeyword.TAG_CONST, SchemaKeyword.TAG_ENUM
        );
        return requiringAnyOfWrapper.map(config::getKeyword).noneMatch(node::has);
    }
Preparation Step: combine the collected attributes and the javaType's definition in the given targetNode.

@param <M> type of target scope, i.e. either a field or method
@param targetNode node in the JSON schema that should represent the associated javaType and include the separately collected attributes
@param memberDetails details for field/method to populate schema for
@param collectedMemberAttributes separately collected attribute for the field/method in their respective declaring type
@see #populateFieldSchema(FieldScope)
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/SchemaGenerationContextImpl.java