|
25 | 25 | import org.eclipse.microprofile.config.Config; |
26 | 26 | import org.openapitools.codegen.config.GlobalSettings; |
27 | 27 |
|
28 | | -import io.quarkiverse.openapi.generator.OpenApiGeneratorException; |
29 | 28 | import io.quarkiverse.openapi.generator.deployment.CodegenConfig; |
30 | 29 | import io.quarkiverse.openapi.generator.deployment.circuitbreaker.CircuitBreakerConfigurationParser; |
31 | 30 | import io.quarkiverse.openapi.generator.deployment.wrapper.OpenApiClassicClientGeneratorWrapper; |
@@ -68,19 +67,13 @@ public String inputDirectory() { |
68 | 67 |
|
69 | 68 | @Override |
70 | 69 | public boolean shouldRun(Path sourceDir, Config config) { |
71 | | - Optional<String> inputBaseDir = getInputBaseDirRelativeToModule(sourceDir, config); |
72 | | - inputBaseDir.ifPresentOrElse(s -> { |
73 | | - if (!Files.isDirectory(Path.of(s))) { |
74 | | - throw new OpenApiGeneratorException(String.format("Invalid path on %s: %s", INPUT_BASE_DIR, s)); |
75 | | - } |
76 | | - }, () -> { |
77 | | - if (!Files.isDirectory(sourceDir) |
78 | | - && !sourceDir.endsWith(Path.of("src", "test", this.inputDirectory()))) { |
79 | | - throw new OpenApiGeneratorException(String.format("Invalid path on %s: %s", INPUT_BASE_DIR, sourceDir)); |
80 | | - } |
81 | | - }); |
| 70 | + String inputBaseDir = getInputBaseDirRelativeToModule(sourceDir, config).orElse(null); |
82 | 71 |
|
83 | | - return true; |
| 72 | + if (inputBaseDir != null) { |
| 73 | + return Files.isDirectory(Path.of(inputBaseDir)); |
| 74 | + } else { |
| 75 | + return Files.isDirectory(sourceDir) || sourceDir.endsWith(Path.of("src", "test", this.inputDirectory())); |
| 76 | + } |
84 | 77 | } |
85 | 78 |
|
86 | 79 | protected boolean isRestEasyReactive(CodeGenContext context) { |
|
0 commit comments