private void performCleanup(ObjectNode definitionsNode, String referenceKeyPrefix) {
        SchemaCleanUpUtils cleanUpUtils = new SchemaCleanUpUtils(this.config);
        if (this.config.shouldCleanupUnnecessaryAllOfElements()) {
            cleanUpUtils.reduceAllOfNodes(this.schemaNodes);
        }
        cleanUpUtils.reduceAnyOfNodes(this.schemaNodes);
        if (this.config.shouldDiscardDuplicateMemberAttributes()) {
            cleanUpUtils.reduceRedundantMemberAttributes(this.schemaNodes, definitionsNode, referenceKeyPrefix);
        }
        if (this.config.shouldIncludeStrictTypeInfo()) {
            cleanUpUtils.setStrictTypeInfo(this.schemaNodes, true);
            // since version 4.37.0 as extraneous "anyOf" wrappers may have been introduced to support type "null"
            cleanUpUtils.reduceAnyOfNodes(this.schemaNodes);
        }
    }
Reduce unnecessary structures in the generated schema definitions. Assumption being that this method is being invoked as the very last action
of the schema generation.

@param definitionsNode object node containing common schema definitions
@param referenceKeyPrefix designated prefix to the entries in the returned definitions node (i.e., on {@link SchemaKeyword#TAG_REF} values)

@see SchemaGeneratorConfig#shouldCleanupUnnecessaryAllOfElements()
@see SchemaCleanUpUtils#reduceAllOfNodes(List)
@see SchemaCleanUpUtils#reduceAnyOfNodes(List)
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/SchemaBuilder.java