{"record":{"id":"44e1907e6d58b8ae","repo":"languagetool-org/languagetool","slug":"you-specified-enabled-but-the-parameter-is-now-c","errorCode":null,"errorMessage":"You specified 'enabled' but the parameter is now called 'enabledRules' in v2 of the API","messagePattern":"You specified 'enabled' but the parameter is now called 'enabledRules' in v2 of the API","errorType":"validation","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"languagetool-server/src/main/java/org/languagetool/server/V2TextChecker.java","lineNumber":101,"sourceCode":"  @NotNull\n  @Override\n  protected List<String> getDisabledRuleIds(Map<String, String> parameters) {\n    return getCommaSeparatedStrings(\"disabledRules\", parameters);\n  }\n\n  @Override\n  protected boolean getLanguageAutoDetect(Map<String, String> parameters) {\n    return \"auto\".equals(parameters.get(\"language\"));\n  }\n\n  @Override\n  protected void checkParams(Map<String, String> parameters) {\n    super.checkParams(parameters);\n    if (StringTools.isEmpty(parameters.get(\"language\"))) {\n      throw new BadRequestException(\"Missing 'language' parameter, e.g. 'language=en-US' for American English or 'language=fr' for French\");\n    }\n    if (parameters.get(\"enabled\") != null) {\n      throw new BadRequestException(\"You specified 'enabled' but the parameter is now called 'enabledRules' in v2 of the API\");\n    }\n    if (parameters.get(\"disabled\") != null) {\n      throw new BadRequestException(\"You specified 'disabled' but the parameter is now called 'disabledRules' in v2 of the API\");\n    }\n    if (parameters.get(\"preferredvariants\") != null) {\n      throw new BadRequestException(\"You specified 'preferredvariants' but the parameter is now called 'preferredVariants' (uppercase 'V') in v2 of the API\");\n    }\n    if (parameters.get(\"autodetect\") != null) {\n      throw new BadRequestException(\"You specified 'autodetect' but automatic language detection is now activated with 'language=auto' in v2 of the API\");\n    }\n  }\n  \n  @Override\n  @NotNull\n  protected DetectedLanguage getLanguage(String text, Map<String, String> parameters, List<String> preferredVariants,\n                                         List<String> noopLangs, List<String> preferredLangs, boolean testMode) {\n    String langParam = parameters.get(\"language\");\n    boolean forcePreferredLanguages = \"true\".equals(parameters.get(\"forcePreferredLanguages\"));","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/V2TextChecker.java#L83-L119","documentation":"The v2 API renamed 'enabled' to 'enabledRules'. V2TextChecker.checkParams() explicitly rejects the old v1 name to help clients migrate, since silently ignoring it would produce wrong rule-enablement behavior.","triggerScenarios":"Calling /v2/check with enabled=... — immediately rejected with HTTP 400 regardless of value.","commonSituations":"Upgrading existing integrations from /v1/check to /v2/check without updating parameter names; code sharing a parameter map between v1 and v2 endpoints.","solutions":["Rename the parameter to enabledRules","Audit all request-building code for other v1 names (disabled, preferredvariants, autodetect)","Consult the v2 API documentation for the full parameter list","If you must support both versions, branch the parameter map per API version"],"exampleFix":"// before\nparams.put(\"enabled\", \"RULE_A,RULE_B\");\n// after\nparams.put(\"enabledRules\", \"RULE_A,RULE_B\");","handlingStrategy":"validation","validationCode":"if ('enabled' in params) { params.enabledRules = params.enabled; delete params.enabled; }","typeGuard":null,"tryCatchPattern":"try { await check(params); } catch (e) { if (/now called 'enabledRules'/.test(e.message)) { /* migrate parameter name */ } throw e; }","preventionTips":["Map v1 names to v2 names in one adapter layer","Grep integration code for 'enabled=' when upgrading","Test against /v2/check in CI after migration"],"tags":["http","api","deprecation","languagetool"],"backgroundTag":"deprecated-api-usage","analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}