code: @SuppressWarnings("UnnecessaryLocalVariable")
  	public static boolean isJsonApiRequest(HttpRequestContext requestContext, boolean acceptPlainJson) {
  		String method = requestContext.getMethod().toUpperCase();
  		boolean isPatch = method.equals(HttpMethod.PATCH.toString());
  		boolean isPost = method.equals(HttpMethod.POST.toString());
  		if (isPatch || isPost) {
  			String contentType = requestContext.getRequestHeader(HttpHeaders.HTTP_CONTENT_TYPE);
  			if (contentType == null || !contentType.startsWith(HttpHeaders.JSONAPI_CONTENT_TYPE)) {
  				LOGGER.warn("not a JSON-API request due to content type {}", contentType);
  				return false;
  			}
  		}
  
  		// short-circuit each of the possible Accept MIME type checks, so that we don't keep comparing after we have already
  		// found a match. Intentionally kept as separate statements (instead of a big, chained ||) to ease debugging/maintenance.
  		boolean acceptsJsonApi = requestContext.accepts(HttpHeaders.JSONAPI_CONTENT_TYPE);
  		boolean acceptsAny = acceptsJsonApi || requestContext.acceptsAny();
  
  		boolean acceptsPlainJson = acceptsAny || (acceptPlainJson && requestContext.accepts("application/json"));
  		LOGGER.debug("accepting request as JSON-API: {}", acceptPlainJson);
  		return acceptsPlainJson;
  	}
docs: Determines whether the supplied HTTP request is considered a JSON-API request.
  
  @param requestContext The HTTP request
  @param acceptPlainJson Whether a plain JSON request should also be considered a JSON-API request
  @return <code>true</code> if it is a JSON-API request; <code>false</code> otherwise
  @since 2.4