Class ProtocolTestValidationUtils

java.lang.Object
software.amazon.smithy.protocoltests.traits.ProtocolTestValidationUtils

public final class ProtocolTestValidationUtils extends Object
Shared validation utility functions for protocol tests.
  • Method Details

    • validateMediaType

      public static Optional<Exception> validateMediaType(String body, String rawMediaType)
      Checks whether a body is well-formed according to its mediaType.

      If the body is not well-formed, a exception with context will be returned.

      Currently XML and JSON validation are supported.

      Parameters:
      body - The body to validate.
      rawMediaType - The mediaType to validate the body with.
      Returns:
      Returns an Optional Exception if the body is not valid.