public SchemaGenerationContextImpl addReference(ResolvedType javaType, ObjectNode referencingNode,
            CustomDefinitionProviderV2 ignoredDefinitionProvider, boolean isNullable) {
        if (referencingNode == null) {
            // referencingNode should only be null for the main class for which the schema is being generated
            return this;
        }
        Map<DefinitionKey, List<ObjectNode>> targetMap = isNullable ? this.nullableReferences : this.references;
        DefinitionKey key = new DefinitionKey(javaType, ignoredDefinitionProvider);
        List<ObjectNode> valueList = targetMap.computeIfAbsent(key, k -> new ArrayList<>());
        valueList.add(referencingNode);
        return this;
    }
Remember for the specified type that the given node is supposed to either include or reference the type's associated schema.

@param javaType type for which to remember a reference
@param referencingNode node that should (later) include either the type's respective inline definition or a "$ref" to the definition
@param ignoredDefinitionProvider first custom definition provider that was ignored when creating the definition (is null in most cases)
@param isNullable whether the reference may be null
@return this context (for chaining)
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/SchemaGenerationContextImpl.java