diff --git a/modules/swagger-generator/src/main/java/io/swagger/generator/online/Generator.java b/modules/swagger-generator/src/main/java/io/swagger/generator/online/Generator.java index 9b721d36a4f..0ecd2756fbe 100644 --- a/modules/swagger-generator/src/main/java/io/swagger/generator/online/Generator.java +++ b/modules/swagger-generator/src/main/java/io/swagger/generator/online/Generator.java @@ -90,10 +90,19 @@ private static String generate(String language, GeneratorInput opts, Type type) throw new BadRequestException("The swagger specification supplied was not valid"); } + String destPath = null; + + if(opts != null && opts.getOptions() != null) { + destPath = opts.getOptions().get("outputFolder"); + } + if(destPath == null) { + destPath = language + "-" + + type.getTypeName(); + } + ClientOptInput clientOptInput = new ClientOptInput(); ClientOpts clientOpts = new ClientOpts(); - String outputFolder = getTmpFolder().getAbsolutePath() + File.separator + language + "-" - + type.getTypeName(); + String outputFolder = getTmpFolder().getAbsolutePath() + File.separator + destPath; String outputFilename = outputFolder + "-bundle.zip"; clientOptInput