code: @Override
    public ActionRequestValidationException validate() {
      ActionRequestValidationException validationException = super.validate();
      if (termsEncoding != null && termsEncoding.equals(TermsEncoding.BYTES)) {
        if (maxTermsPerShard == null) {
          validationException = ValidateActions.addValidationError("maxTermsPerShard not specified for terms encoding [bytes]", validationException);
        }
      }
      return validationException;
    }
docs: Validates the request
  
  @return null if valid, exception otherwise