Skip to content

Commit 78b54b9

Browse files
authored
Fix broken build on Windows OS if the schema contains references to other schema files. (#21300)
1 parent 0aaeb45 commit 78b54b9

File tree

1 file changed

+6
-0
lines changed
  • modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin

1 file changed

+6
-0
lines changed

modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,18 @@ public void execute() throws MojoExecutionException {
563563
}
564564

565565
if (StringUtils.isNotBlank(inputSpecRootDirectory)) {
566+
// make sure the path can be processed correct under Windows OS
567+
inputSpecRootDirectory = inputSpecRootDirectory.replaceAll("\\\\", "/");
568+
566569
inputSpec = new MergedSpecBuilder(inputSpecRootDirectory, mergedFileName,
567570
mergedFileInfoName, mergedFileInfoDescription, mergedFileInfoVersion)
568571
.buildMergedSpec();
569572
LOGGER.info("Merge input spec would be used - {}", inputSpec);
570573
}
571574

575+
// make sure the path can be processed correct under Windows OS
576+
inputSpec = inputSpec.replaceAll("\\\\", "/");
577+
572578
File inputSpecFile = new File(inputSpec);
573579

574580
if (output == null) {

0 commit comments

Comments
 (0)