|
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; |
@@ -69,19 +68,13 @@ public String inputDirectory() { |
69 | 68 |
|
70 | 69 | @Override |
71 | 70 | public boolean shouldRun(Path sourceDir, Config config) { |
72 | | - Optional<String> inputBaseDir = getInputBaseDirRelativeToModule(sourceDir, config); |
73 | | - inputBaseDir.ifPresentOrElse(s -> { |
74 | | - if (!Files.isDirectory(Path.of(s))) { |
75 | | - throw new OpenApiGeneratorException(String.format("Invalid path on %s: %s", INPUT_BASE_DIR, s)); |
76 | | - } |
77 | | - }, () -> { |
78 | | - if (!Files.isDirectory(sourceDir) |
79 | | - && !sourceDir.endsWith(Path.of("src", "test", this.inputDirectory()))) { |
80 | | - throw new OpenApiGeneratorException(String.format("Invalid path on %s: %s", INPUT_BASE_DIR, sourceDir)); |
81 | | - } |
82 | | - }); |
| 71 | + String inputBaseDir = getInputBaseDirRelativeToModule(sourceDir, config).orElse(null); |
83 | 72 |
|
84 | | - return true; |
| 73 | + if (inputBaseDir != null) { |
| 74 | + return Files.isDirectory(Path.of(inputBaseDir)); |
| 75 | + } else { |
| 76 | + return Files.isDirectory(sourceDir) || sourceDir.endsWith(Path.of("src", "test", this.inputDirectory())); |
| 77 | + } |
85 | 78 | } |
86 | 79 |
|
87 | 80 | protected boolean isRestEasyReactive(CodeGenContext context) { |
|
0 commit comments