private Optional<ValidationEvent> validateOperationsWithHttpTrait(Model model, OperationShape operation) {
        HttpTrait trait = operation.expectTrait(HttpTrait.class);
        if (trait.getCode() < 200 || trait.getCode() >= 300) {
            return Optional.of(invalidOperation(operation, trait));
        }

        if (trait.getCode() == 204 || trait.getCode() == 205) {
            if (HttpBindingIndex.of(model).hasResponseBody(operation)) {
                return Optional.of(warning(operation,
                        String.format(
                                "The HTTP %d status code does not allow a response body. To use this status code, all output "
                                        + "members need to be bound to @httpHeader, @httpPrefixHeaders, @httpResponseCode, etc.",
                                trait.getCode())));
            }
        }

        return Optional.empty();
    }
Ensures that HTTP response codes are appropriate for operations and errors.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpResponseCodeSemanticsValidator.java