ruanwenjun commented on code in PR #5931:
URL: https://github.com/apache/seatunnel/pull/5931#discussion_r1412806380
##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigValidator.java:
##########
@@ -45,14 +45,18 @@ public void validate(OptionRule rule) {
List<RequiredOption> requiredOptions = rule.getRequiredOptions();
for (RequiredOption requiredOption : requiredOptions) {
validate(requiredOption);
- requiredOption
- .getOptions()
- .forEach(
- option -> {
- if
(SingleChoiceOption.class.isAssignableFrom(option.getClass())) {
- validateSingleChoice(option);
- }
- });
+
+ for (Option<?> option : requiredOption.getOptions()) {
+ if
(SingleChoiceOption.class.isAssignableFrom(option.getClass())) {
+ // is required option and not match condition, skip
validate
+ if (isConditionOption(requiredOption)
+ && !matchCondition(
+
(RequiredOption.ConditionalRequiredOptions) requiredOption)) {
+ continue;
+ }
+ validateSingleChoice(option);
+ }
+ }
Review Comment:
This fix we have some options which have the same key but different excepted
values, which will be set under different condition.
e.g. `compress_code` in file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]