code: public boolean isJsonMime(String mime) {
        String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
        return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json"));
      }
docs: Check if the given MIME is a JSON MIME.
  JSON MIME examples:
  application/json
  application/json; charset=UTF8
  APPLICATION/JSON
  application/vnd.company+json
  @param mime MIME (Multipurpose Internet Mail Extensions)
  @return True if the given MIME is JSON, false otherwise.