languagetool-org/languagetool · error · BadRequestException
You specified 'enabled' but the parameter is now called 'ena
Error message
You specified 'enabled' but the parameter is now called 'enabledRules' in v2 of the API
What it means
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.
Source
Thrown at languagetool-server/src/main/java/org/languagetool/server/V2TextChecker.java:101
@NotNull
@Override
protected List<String> getDisabledRuleIds(Map<String, String> parameters) {
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"));View on GitHub (pinned to 2e990059ce)
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
Example fix
// before
params.put("enabled", "RULE_A,RULE_B");
// after
params.put("enabledRules", "RULE_A,RULE_B"); Defensive patterns
Strategy: validation
Validate before calling
if ('enabled' in params) { params.enabledRules = params.enabled; delete params.enabled; } Try / catch
try { await check(params); } catch (e) { if (/now called 'enabledRules'/.test(e.message)) { /* migrate parameter name */ } throw e; } Prevention
- 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
When it happens
Trigger: Calling /v2/check with enabled=... — immediately rejected with HTTP 400 regardless of value.
Common situations: Upgrading existing integrations from /v1/check to /v2/check without updating parameter names; code sharing a parameter map between v1 and v2 endpoints.
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
- You specified 'disabled' but the parameter is now called 'di
- You specified 'preferredvariants' but the parameter is now c
- You specified 'autodetect' but automatic language detection
- This end point needs a user id
- Only either 'text' or 'markup' are supported in an object in
AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06).
Data as JSON: /api/errors/44e1907e6d58b8ae.
Report an issue: GitHub.