@Override
        public Stream<ValidationEvent> visitEndpoint(Endpoint endpoint) {
            List<ValidationEvent> events = new ArrayList<>();

            Literal authSchemes = endpoint.getProperties().get(Identifier.of("authSchemes"));
            if (authSchemes != null) {
                BiFunction<FromSourceLocation, String, ValidationEvent> emitter = getEventEmitter();
                Optional<List<Literal>> authSchemeList = authSchemes.asTupleLiteral();
                if (!authSchemeList.isPresent()) {
                    return Stream.of(emitter.apply(authSchemes,
                            String.format("Expected `authSchemes` to be a list, found: `%s`", authSchemes)));
                }

                Set<String> authSchemeNames = new HashSet<>();
                Set<String> duplicateAuthSchemeNames = new HashSet<>();
                for (Literal authSchemeEntry : authSchemeList.get()) {
                    Optional<Map<Identifier, Literal>> authSchemeMap = authSchemeEntry.asRecordLiteral();
                    if (authSchemeMap.isPresent()) {
                        // Validate the name property so that we can also check that they're unique.
                        Map<Identifier, Literal> authScheme = authSchemeMap.get();
                        Optional<ValidationEvent> event = validateAuthSchemeName(authScheme, authSchemeEntry);
                        if (event.isPresent()) {
                            events.add(event.get());
                            continue;
                        }
                        String schemeName = authScheme.get(NAME).asStringLiteral().get().expectLiteral();
                        if (!authSchemeNames.add(schemeName)) {
                            duplicateAuthSchemeNames.add(schemeName);
                        }

                        events.addAll(validateAuthScheme(schemeName, authScheme, authSchemeEntry));
                    } else {
                        events.add(emitter.apply(authSchemes,
                                String.format("Expected `authSchemes` to be a list of objects, but found: `%s`",
                                        authSchemeEntry)));
                    }
                }

                // Emit events for each duplicated auth scheme name.
                for (String duplicateAuthSchemeName : duplicateAuthSchemeNames) {
                    events.add(emitter.apply(authSchemes,
                            String.format("Found duplicate `name` of `%s` in the "
                                    + "`authSchemes` list", duplicateAuthSchemeName)));
                }
            }

            return events.stream();
        }
Validator which verifies an endpoint with an authSchemes property conforms to a strict schema.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetAuthSchemesValidator.java