private Optional<ValidationEvent> checkForMissing(ResourceShape resource, ResourceShape parent) {
        // Look for identifiers on the parent that are flat-out missing on the child.
        String missingKeys = parent.getIdentifiers()
                .entrySet()
                .stream()
                .filter(entry -> resource.getIdentifiers().get(entry.getKey()) == null)
                .map(Map.Entry::getKey)
                .sorted()
                .collect(Collectors.joining(", "));

        if (missingKeys.isEmpty()) {
            return Optional.empty();
        }

        return Optional.of(error(resource,
                String.format(
                        "This resource is bound as a child of `%s`, but it is invalid because its `identifiers` property "
                                + "is missing the following identifiers that are defined in `%s`: [%s]",
                        parent.getId(),
                        parent.getId(),
                        missingKeys)));
    }
Validates that the resource identifiers of children of a resource contain
all of the identifiers as their parents.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceIdentifierValidator.java