languagetool-org/languagetool · error · BadRequestException

You specified 'disabled' but the parameter is now called 'di

Error message

You specified 'disabled' but the parameter is now called 'disabledRules' in v2 of the API

What it means

API migration guard in V2TextChecker.checkParams: the request uses the v1 parameter name 'enabled'/'disabled', which v2 of the HTTP API renamed; the old name is rejected to force clients onto the v2 schema.

Source

Thrown at languagetool-server/src/main/java/org/languagetool/server/V2TextChecker.java:104

    return getCommaSeparatedStrings("disabledRules", parameters);
  }

  @Override
  protected boolean getLanguageAutoDetect(Map<String, String> parameters) {
    return "auto".equals(parameters.get("language"));
  }

  @Override
  protected void checkParams(Map<String, String> parameters) {
    super.checkParams(parameters);
    if (StringTools.isEmpty(parameters.get("language"))) {
      throw new BadRequestException("Missing 'language' parameter, e.g. 'language=en-US' for American English or 'language=fr' for French");
    }
    if (parameters.get("enabled") != null) {
      throw new BadRequestException("You specified 'enabled' but the parameter is now called 'enabledRules' in v2 of the API");
    }
    if (parameters.get("disabled") != null) {
      throw new BadRequestException("You specified 'disabled' but the parameter is now called 'disabledRules' in v2 of the API");
    }
    if (parameters.get("preferredvariants") != null) {
      throw new BadRequestException("You specified 'preferredvariants' but the parameter is now called 'preferredVariants' (uppercase 'V') in v2 of the API");
    }
    if (parameters.get("autodetect") != null) {
      throw new BadRequestException("You specified 'autodetect' but automatic language detection is now activated with 'language=auto' in v2 of the API");
    }
  }
  
  @Override
  @NotNull
  protected DetectedLanguage getLanguage(String text, Map<String, String> parameters, List<String> preferredVariants,
                                         List<String> noopLangs, List<String> preferredLangs, boolean testMode) {
    String langParam = parameters.get("language");
    boolean forcePreferredLanguages = "true".equals(parameters.get("forcePreferredLanguages"));
    DetectedLanguage detectedLang = detectLanguageOfString(text, null, preferredVariants, noopLangs, preferredLangs, forcePreferredLanguages);
    Language givenLang;
    if (getLanguageAutoDetect(parameters)) {

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Rename the parameter to disabledRules
  2. Search the codebase for other v1 parameter names (enabled, preferredvariants, autodetect)
  3. Check the v2 API docs for current parameter names
  4. Version-gate parameter construction if supporting both API versions

Example fix

// before
params.put("disabled", "TYPO_RULE");
// after
params.put("disabledRules", "TYPO_RULE");
Defensive patterns

Strategy: validation

Validate before calling

if ('disabled' in params) { params.disabledRules = params.disabled; delete params.disabled; }

Try / catch

try { await check(params); } catch (e) { if (/now called 'disabledRules'/.test(e.message)) { /* migrate parameter name */ } throw e; }

Prevention

When it happens

Trigger: Calling /v2/check with disabled=... — rejected with HTTP 400 before any checking happens.

Common situations: v1-to-v2 migration leftovers; shared request builders used against both API versions; tutorials or snippets copied from old v1 documentation.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06). Data as JSON: /api/errors/4666f114e416659e. Report an issue: GitHub.