private Optional<ValidationEvent> syntax(Shape shape, ArnTrait trait) {
        List<String> invalid = trait.getLabels()
                .stream()
                .filter(expr -> !EXPRESSION_PATTERN.matcher(expr).find())
                .collect(toList());

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

        return Optional.of(error(shape,
                trait,
                String.format(
                        "aws.api#arn trait contains invalid template labels: %s. Template labels must match the "
                                + "following regular expression: %s",
                        tickedList(invalid),
                        EXPRESSION_PATTERN.pattern())));
    }
Ensures that all arn traits for a service are valid and that their templates
only reference valid resource identifiers.
smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnTemplateValidator.java