Class ProtocolTestValidationUtils
java.lang.Object
software.amazon.smithy.protocoltests.traits.ProtocolTestValidationUtils
Shared validation utility functions for protocol tests.
-
Method Summary
Modifier and TypeMethodDescriptionvalidateMediaType(String body, String rawMediaType) Checks whether a body is well-formed according to its mediaType.
-
Method Details
-
validateMediaType
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.
-