private void addPropertiesToDefinition(ObjectNode definition, List<MemberScope<?, ?>> sortedProperties, Set<String> requiredPropertyNames) {
        ObjectNode propertiesNode = definition.putObject(this.getKeyword(SchemaKeyword.TAG_PROPERTIES));
        Map<String, List<String>> dependentRequires = new LinkedHashMap<>();
        for (MemberScope<?, ?> property : sortedProperties) {
            this.addPropertiesEntry(propertiesNode, dependentRequires, property);
        }
        if (!requiredPropertyNames.isEmpty()) {
            ArrayNode requiredNode = definition.putArray(this.getKeyword(SchemaKeyword.TAG_REQUIRED));
            // list required properties in the same order as the property
            sortedProperties.stream()
                    .map(MemberScope::getSchemaPropertyName)
                    .filter(requiredPropertyNames::contains)
                    .forEach(requiredNode::add);
        }
        if (!dependentRequires.isEmpty()) {
            ObjectNode dependentRequiredNode = definition.putObject(this.getKeyword(SchemaKeyword.TAG_DEPENDENT_REQUIRED));
            dependentRequires.forEach((leadName, dependentNames) -> dependentNames
                    .forEach(dependentRequiredNode.withArray(leadName)::add));
        }
    }
Preparation Step: add the given targetType (which was previously determined to be anything but an array type).

@param targetType object type to add
@param definition node in the JSON schema to which all collected attributes should be added
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/SchemaGenerationContextImpl.java