private List<ValidationEvent> validateOperation(
            Model model,
            TopDownIndex topDownIndex,
            OperationIndex opIndex,
            OperationShape operation,
            PaginatedTrait trait
    ) {
        List<ValidationEvent> events = new ArrayList<>();

        // Validate input.
        events.addAll(validateMember(opIndex, model, null, operation, trait, new InputTokenValidator()));
        PageSizeValidator pageSizeValidator = new PageSizeValidator();
        events.addAll(validateMember(opIndex, model, null, operation, trait, pageSizeValidator));
        pageSizeValidator.getMember(model, opIndex, operation, trait)
                .filter(MemberShape::isRequired)
                .ifPresent(member -> events.add(warning(
                        operation,
                        trait,
                        String.format(
                                "paginated trait `%s` member `%s` should not be required",
                                pageSizeValidator.propertyName(),
                                member.getMemberName()),
                        SHOULD_NOT_BE_REQUIRED,
                        pageSizeValidator.propertyName())));

        // Validate output.
        events.addAll(validateMember(opIndex, model, null, operation, trait, new OutputTokenValidator()));
        events.addAll(validateMember(opIndex, model, null, operation, trait, new ItemValidator()));

        if (events.isEmpty()) {
            model.shapes(ServiceShape.class).forEach(svc -> {
                if (topDownIndex.getContainedOperations(svc).contains(operation)) {
                    // Create a merged trait if one is present on the service.
                    PaginatedTrait merged = svc.getTrait(PaginatedTrait.class).map(trait::merge).orElse(trait);
                    events.addAll(validateMember(opIndex, model, svc, operation, merged, new InputTokenValidator()));
                    events.addAll(validateMember(opIndex, model, svc, operation, merged, new PageSizeValidator()));
                    events.addAll(validateMember(opIndex, model, svc, operation, merged, new OutputTokenValidator()));
                    events.addAll(validateMember(opIndex, model, svc, operation, merged, new ItemValidator()));
                }
            });
        }

        return events;
    }
Validates paginated traits.

<ul>
    <li>The inputToken and outputToken properties must be set when an
     operation's properties are optionally merged with a service's.</li>
    <li>The items property, if set, must reference a list or map
     output member.</li>
    <li>The pageSize property, if set, should reference an optional integer
     input member. It may, but should not reference an optional byte, short,
     or long.</li>
    <li>The inputToken property should reference an optional string input
     member. It may, but should not reference an optional map.</li>
    <li>The outputToken property should reference an optional string output
     member. It may, but should not reference an optional map.</li>
</ul>
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PaginatedTraitValidator.java