{"record":{"id":"e4f22fc392cff8f8","repo":"apache/seatunnel","slug":"parameter-type-cannot-be-empty","errorCode":null,"errorMessage":"Parameter 'type' cannot be empty.","messagePattern":"Parameter 'type' cannot be empty\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/OptionRulesService.java","lineNumber":193,"sourceCode":"    }\n\n    private LinkedHashMap<PluginIdentifier, OptionRule> getDiscoveredPlugins(\n            PluginType pluginType) {\n        return discoveredPluginsCache.computeIfAbsent(\n                pluginType,\n                key -> {\n                    PluginDiscovery<?> pluginDiscovery = pluginDiscoveries.get(key);\n                    if (pluginDiscovery == null) {\n                        throw new IllegalArgumentException(\n                                String.format(\"Unsupported plugin type: %s\", pluginType.getType()));\n                    }\n                    return pluginDiscovery.getPlugins();\n                });\n    }\n\n    private PluginType parseSupportedPluginType(String pluginTypeText) {\n        if (StringUtils.isBlank(pluginTypeText)) {\n            throw new IllegalArgumentException(\n                    String.format(\"Parameter '%s' cannot be empty.\", PARAM_TYPE));\n        }\n        String normalizedPluginType = pluginTypeText.trim();\n        if (StringUtils.equalsIgnoreCase(normalizedPluginType, PluginType.SOURCE.getType())) {\n            return PluginType.SOURCE;\n        }\n        if (StringUtils.equalsIgnoreCase(normalizedPluginType, PluginType.SINK.getType())) {\n            return PluginType.SINK;\n        }\n        if (StringUtils.equalsIgnoreCase(normalizedPluginType, PluginType.TRANSFORM.getType())) {\n            return PluginType.TRANSFORM;\n        }\n        throw new IllegalArgumentException(\n                String.format(\n                        \"Unsupported plugin type '%s'. Only '%s', '%s' and '%s' are supported.\",\n                        normalizedPluginType,\n                        PluginType.SOURCE.getType(),\n                        PluginType.SINK.getType(),","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/OptionRulesService.java#L175-L211","documentation":"parseSupportedPluginType validates the 'type' query parameter of the option-rules endpoint and rejects blank/empty values with this IllegalArgumentException. The endpoint cannot enumerate or guess a plugin type, so the parameter is mandatory and non-blank.","triggerScenarios":"GET /option-rules with no type parameter, an empty type=, or a whitespace-only value (StringUtils.isBlank check).","commonSituations":"Hand-built URLs missing the query parameter; client code passing a null/empty variable for type; template strings where the type placeholder was not substituted.","solutions":["Append a valid type query parameter: ?type=source (or sink / transform).","In client code, default the type explicitly or validate it is non-blank before building the URL.","If multiple types are wanted, issue one request per supported type instead of omitting type."],"exampleFix":"// before\ncurl 'http://host:8080/option-rules?type='\n// after\ncurl 'http://host:8080/option-rules?type=source'","handlingStrategy":"validation","validationCode":"if (typeof type !== \"string\" || !type.trim()) throw new Error(\"option-rules requires a non-empty 'type' parameter\");","typeGuard":"function isValidPluginTypeParam(v) {\n  return typeof v === \"string\" && v.trim().length > 0;\n}","tryCatchPattern":"try { fetchOptionRules(type); } catch (IllegalArgumentException e) { if (e.getMessage().includes(\"cannot be empty\")) { fetchOptionRules(\"source\"); } else throw e; }","preventionTips":["Always build option-rules URLs through a helper that enforces a non-blank type.","Add a client default type when the caller omits one.","Check URLs for unsubstituted template placeholders before issuing requests."],"tags":["rest-api","validation","missing-parameter","plugin"],"backgroundTag":"empty-required-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}