private void reduceRedundantMemberAttributesIfPossible(ObjectNode schemaNode,
            String propertiesKeyword, String refKeyword, Map<String, Map<String, JsonNode>> definitions) {
        JsonNode propertiesNode = schemaNode.get(propertiesKeyword);
        if (propertiesNode == null || !propertiesNode.isObject()) {
            return;
        }
        for (Iterator<JsonNode> it = propertiesNode.elements(); it.hasNext(); ) {
            JsonNode memberSchema = it.next();
            JsonNode reference = memberSchema.get(refKeyword);
            if (reference == null || !(memberSchema instanceof ObjectNode)) {
                // only considering a property/member schema containing a direct reference to a common definition
                continue;
            }
            if (definitions.containsKey(reference.asText())) {
                this.reduceRedundantAttributesIfPossible((ObjectNode) memberSchema, definitions.get(reference.asText()));
            }
        }
    }
Discard attributes on member schemas, that also reference an entry in the common definitions, which contains those exact same attributes.

@param schemaNode single schema to check for properties, which in turn contain redundant attributes to be removed
@param propertiesKeyword keyword under which to find an object schema's properties
@param refKeyword keyword containing the reference to a common schema definition
@param definitions object node containing common schema definitions
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/SchemaCleanUpUtils.java