private List<ValidationEvent> validateMediaType(Shape shape, Trait trait, HttpMessageTestCase test) {
        // Only validate the body if it's a non-empty string. Some protocols
        // require a content-type header even with no payload.
        if (!test.getBody().filter(s -> !s.isEmpty()).isPresent()) {
            return Collections.emptyList();
        }

        String rawMediaType = test.getBodyMediaType().orElse("application/octet-stream");
        MediaType mediaType = MediaType.from(rawMediaType);
        List<ValidationEvent> events = new ArrayList<>();
        if (isXml(mediaType)) {
            validateXml(shape, trait, test).ifPresent(events::add);
        } else if (isJson(mediaType)) {
            validateJson(shape, trait, test).ifPresent(events::add);
        }

        return events;
    }
Validates the following:

<ul>
    <li>XML and JSON bodyMediaTypes contain valid content.</li>
    <li>vendorParamsShape is a valid shape.</li>
    <li>Vendor params are compatible with any referenced shape.</li>
    <li>Params for a test case are valid for the model.</li>
</ul>

@param <T> Type of test case to validate.
smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/ProtocolTestCaseValidator.java