public static void mergeMissingAttributes(ObjectNode targetNode, ObjectNode attributeContainer) {
        if (attributeContainer == null) {
            return;
        }
        Iterator<Map.Entry<String, JsonNode>> attributeIterator = attributeContainer.fields();
        while (attributeIterator.hasNext()) {
            Map.Entry<String, JsonNode> attribute = attributeIterator.next();
            if (!targetNode.has(attribute.getKey())) {
                targetNode.set(attribute.getKey(), attribute.getValue());
            }
        }
    }
Merge the second node's attributes into the first, skipping those attributes that are already contained in the first node.

@param targetNode node to add non-existent attributes to
@param attributeContainer container holding attributes to add to the first node
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/AttributeCollector.java