code: func (r QueryRequest) Validate() error {
  	if r.Query == "" && r.Spec == nil && r.AST == nil {
  		return errors.New(`request body requires either query, spec, or AST`)
  	}
  
  	if r.Type != "flux" {
  		return fmt.Errorf(`unknown query type: %s`, r.Type)
  	}
  
  	if len(r.Dialect.CommentPrefix) > 1 {
  		return fmt.Errorf("invalid dialect comment prefix: must be length 0 or 1")
  	}
  
  	if len(r.Dialect.Delimiter) != 1 {
  		return fmt.Errorf("invalid dialect delimeter: must be length 1")
  	}
  
  	rune, size := utf8.DecodeRuneInString(r.Dialect.Delimiter)
  	if rune == utf8.RuneError && size == 1 {
  		return fmt.Errorf("invalid dialect delimeter character")
  	}
  
  	for _, a := range r.Dialect.Annotations {
  		switch a {
  		case "group", "datatype", "default":
  		default:
  			return fmt.Errorf(`unknown dialect annotation type: %s`, a)
  		}
  	}
  
  	switch r.Dialect.DateTimeFormat {
  	case "RFC3339", "RFC3339Nano":
  	default:
  		return fmt.Errorf(`unknown dialect date time format: %s`, r.Dialect.DateTimeFormat)
  	}
  
  	return nil
  }
docs: // Validate checks the query request and returns an error if the request is invalid.