I wonder if we should strive to be consistent (in either lenient mode or strict 
mode) through out Solr?   For example, I noticed that the AuthTool does a check 
for "true" or "false" with some custom code.   If we said that on, off, etc are 
all valid choices, then we could support that through out?  Instead of some 
places have one set of rules, and others something different.

  private void ensureArgumentIsValidBooleanIfPresent(CommandLine cli, String 
argName) {
    if (cli.hasOption(argName)) {
      final String value = cli.getOptionValue(argName);
      if (!"true".equalsIgnoreCase(value) && !"false".equalsIgnoreCase(value)) {
        echo("Argument [" + argName + "] must be either true or false, but was 
[" + value + "]");
        SolrCLI.exit(1);
      }
    }
  }
On 2023/09/18 23:50:36 "tflobbe (via GitHub)" wrote:
> 
> tflobbe commented on PR #1931:
> URL: https://github.com/apache/solr/pull/1931#issuecomment-1724631857
> 
>    @gerlowskija Any thoughts here? I'm on the fence. I don't really love the 
> leniency with which we are reading boolean params here, it seems more useful 
> for configuration files than it is for request parameters, but that's what 
> other parts of the code are using, so I also want to consider consistency 
> with other APIs. 
>    As far as I can tell, pre-Solr9 most Collections API parameters 
> `ZkNodeProps`, which uses `Boolean.getBoolean` (case insensitive), so that's 
> why they worked before and not now.
> 
> 
> -- 
> This is an automated message from the Apache Git Service.
> To respond to the message, please log on to GitHub and use the
> URL above to go to the specific comment.
> 
> To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
> 
> For queries about this service, please contact Infrastructure at:
> us...@infra.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
> For additional commands, e-mail: issues-h...@solr.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to