{"record":{"id":"c883c8755384ce5a","repo":"apache/seatunnel","slug":"conditional-option-s-must-have-expect-values","errorCode":null,"errorMessage":"conditional option '%s' must have expect values .","messagePattern":"conditional option '(.+?)' must have expect values \\.","errorType":"validation","errorClass":"org.apache.seatunnel.api.configuration.util.OptionValidationException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/OptionRule.java","lineNumber":221,"sourceCode":"            if (options.length <= 1) {\n                throw new OptionValidationException(\n                        \"The number of exclusive options must be greater than 1.\");\n            }\n            RequiredOption.ExclusiveRequiredOptions exclusiveRequiredOption =\n                    RequiredOption.ExclusiveRequiredOptions.of(options);\n            verifyRequiredOptionDuplicate(exclusiveRequiredOption);\n            this.requiredOptions.add(exclusiveRequiredOption);\n            return this;\n        }\n\n        public <T> Builder conditional(\n                @NonNull Option<T> conditionalOption,\n                @NonNull List<T> expectValues,\n                @NonNull Option<?>... requiredOptions) {\n            verifyConditionalExists(conditionalOption);\n\n            if (expectValues.isEmpty()) {\n                throw new OptionValidationException(\n                        String.format(\n                                \"conditional option '%s' must have expect values .\",\n                                conditionalOption.key()));\n            }\n\n            Expression expression =\n                    expectValues.stream()\n                            .map(v -> Expression.of(Condition.of(conditionalOption, v)))\n                            .reduce(Expression::or)\n                            .get();\n\n            RequiredOption.ConditionalRequiredOptions option =\n                    RequiredOption.ConditionalRequiredOptions.of(\n                            expression, new ArrayList<>(Arrays.asList(requiredOptions)));\n            verifyRequiredOptionDuplicate(option, true);\n            this.requiredOptions.add(option);\n            return this;\n        }","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/OptionRule.java#L203-L239","documentation":"A developer-facing builder guard in OptionRule.Builder.conditional: a conditional option was declared with an empty list of expect values, so no condition could ever match. The faulting input is the expectValues list passed for the conditional option.","triggerScenarios":"Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/OptionRule.java:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty list of expected values when calling Builder.conditional(...)","Verify the value type of the conditional option matches the expected values","Fix the connector's OptionRule definition code, not the user config"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}