Class ValidationMediaTypes

java.lang.Object
ch.nexsol.gateway.validation.ValidationMediaTypes

public final class ValidationMediaTypes extends Object
Which media types this plugin can hold against a schema.
  • Method Details

    • isJson

      public static boolean isJson(org.springframework.http.MediaType contentType)
      Returns whether a body of this media type can be validated against a JSON schema. Everything else — a multipart upload, a binary stream, an image, a form submission — carries nothing a JSON schema could be applied to, which is what lets the filter decide not to buffer it at all.
      Parameters:
      contentType - the media type of the body, may be null
      Returns:
      true for application/json and any +json suffixed type