private boolean shouldCreateNullableDefinition(SchemaGenerationContextImpl generationContext, DefinitionKey definitionKey,
            List<ObjectNode> nullableReferences) {
        if (this.config.shouldInlineNullableSchemas()) {
            return false;
        }
        if (generationContext.shouldNeverInlineDefinition(definitionKey)) {
            return true;
        }
        if (this.config.shouldInlineAllSchemas()) {
            return false;
        }
        return this.config.shouldCreateDefinitionsForAllObjects() || nullableReferences.size() > 1;
    }
Finalisation Step: collect the entries for the generated schema's "definitions" and ensure that all references are either pointing to the
appropriate definition or contain the respective (sub) schema directly inline.

@param referenceKeyPrefix designated prefix to the entries in the returned definitions node (i.e., on {@link SchemaKeyword#TAG_REF} values)
@param mainSchemaKey definition key identifying the main type for which createSchemaReference() was invoked
@return node representing the main schema's "definitions" (may be empty)
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/SchemaBuilder.java