Skip to content

Commit edbb021

Browse files
authored
skip setting output folder in online service (#18652)
1 parent 4a872a8 commit edbb021

File tree

1 file changed

+3
-8
lines changed
  • modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service

1 file changed

+3
-8
lines changed

modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java

+3-8
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,9 @@ private static String generate(String language, GeneratorInput opts, Type type)
118118
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The OpenAPI specification supplied was not valid");
119119
}
120120

121-
String destPath = null;
122-
123-
if (opts.getOptions() != null) {
124-
destPath = opts.getOptions().get("outputFolder");
125-
}
126-
if (destPath == null) {
127-
destPath = language + "-" + type.getTypeName();
128-
}
121+
// do not use opts.getOptions().get("outputFolder") as the input can contain ../../
122+
// to access other folders in the server
123+
String destPath = language + "-" + type.getTypeName();
129124

130125
ClientOptInput clientOptInput = new ClientOptInput();
131126
String outputFolder = getTmpFolder().getAbsolutePath() + File.separator + destPath;

0 commit comments

Comments
 (0)