Skip to content

Commit b8d4cf2

Browse files
Merge branch 'master' into dart-double-cast
2 parents 5add662 + 07c64a5 commit b8d4cf2

File tree

214 files changed

+2184
-661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+2184
-661
lines changed

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
[![Build Status](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master-java7/badge/icon?subject=jenkins%20build%20-%20java%207)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master-java7/)
88

9-
- Master (2.4.13-SNAPSHOT): [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen)
9+
- Master (2.4.14-SNAPSHOT): [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen)
1010
[![Java Test](https://img.shields.io/jenkins/build.svg?jobUrl=https://jenkins.swagger.io/job/oss-swagger-codegen-master)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master)
1111
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen)
1212

13-
- 3.0.17-SNAPSHOT: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen)
13+
- 3.0.20-SNAPSHOT: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen)
1414
[![Java Test](https://img.shields.io/jenkins/build.svg?jobUrl=https://jenkins.swagger.io/job/oss-swagger-codegen-3)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-3)
1515
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=3.0.0&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen)
1616

@@ -52,7 +52,7 @@ dependency example:
5252
<dependency>
5353
<groupId>io.swagger</groupId>
5454
<artifactId>swagger-codegen-maven-plugin</artifactId>
55-
<version>2.4.12</version>
55+
<version>2.4.13</version>
5656
</dependency>
5757
```
5858

@@ -70,7 +70,7 @@ dependency example:
7070
<dependency>
7171
<groupId>io.swagger.codegen.v3</groupId>
7272
<artifactId>swagger-codegen-maven-plugin</artifactId>
73-
<version>3.0.16</version>
73+
<version>3.0.19</version>
7474
</dependency>
7575
```
7676

@@ -134,9 +134,12 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
134134

135135
Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
136136
-------------------------- | ------------ | -------------------------- | -----
137-
3.0.17-SNAPSHOT (current 3.0.0, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/codegen/v3/swagger-codegen-cli/3.0.17-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release
138-
[3.0.16](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.16) (**current stable**) | 2020-01-15 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.16](https://github.com/swagger-api/swagger-codegen/tree/v3.0.16)
139-
[3.0.15](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.15) (**current stable**) | 2020-01-03 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.15](https://github.com/swagger-api/swagger-codegen/tree/v3.0.15)
137+
3.0.20-SNAPSHOT (current 3.0.0, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/codegen/v3/swagger-codegen-cli/3.0.20-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release
138+
[3.0.19](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.19) (**current stable**) | 2020-04-02 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.19](https://github.com/swagger-api/swagger-codegen/tree/v3.0.19)
139+
[3.0.18](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.18) | 2020-02-26 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.18](https://github.com/swagger-api/swagger-codegen/tree/v3.0.18)
140+
[3.0.17](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.17) | 2020-02-23 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.17](https://github.com/swagger-api/swagger-codegen/tree/v3.0.17)
141+
[3.0.17](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.16) | 2020-01-15 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.16](https://github.com/swagger-api/swagger-codegen/tree/v3.0.16)
142+
[3.0.15](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.15) | 2020-01-03 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.15](https://github.com/swagger-api/swagger-codegen/tree/v3.0.15)
140143
[3.0.14](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.14) | 2019-11-16 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.14](https://github.com/swagger-api/swagger-codegen/tree/v3.0.14)
141144
[3.0.13](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.13) | 2019-10-16 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.13](https://github.com/swagger-api/swagger-codegen/tree/v3.0.13)
142145
[3.0.12](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.12) | 2019-10-14 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.12](https://github.com/swagger-api/swagger-codegen/tree/v3.0.12)
@@ -151,9 +154,10 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
151154
[3.0.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.2)| 2018-10-19 | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release
152155
[3.0.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.1)| 2018-10-05 | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes
153156
[3.0.0](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.0)| 2018-09-06 | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes
154-
2.4.13-SNAPSHOT (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.4.13-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0 | Minor release
155-
[2.4.12](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.12) (**current stable**) | 2020-01-15 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.12](https://github.com/swagger-api/swagger-codegen/tree/v2.4.12)
156-
[2.4.11](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.11) (**current stable**) | 2020-01-03 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.11](https://github.com/swagger-api/swagger-codegen/tree/v2.4.11)
157+
2.4.14-SNAPSHOT (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.4.14-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0 | Minor release
158+
[2.4.13](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.13) (**current stable**) | 2020-04-02 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.13](https://github.com/swagger-api/swagger-codegen/tree/v2.4.13)
159+
[2.4.12](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.12) | 2020-01-15 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.12](https://github.com/swagger-api/swagger-codegen/tree/v2.4.12)
160+
[2.4.11](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.11) | 2020-01-03 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.11](https://github.com/swagger-api/swagger-codegen/tree/v2.4.11)
157161
[2.4.10](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.10) | 2019-11-16 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.10](https://github.com/swagger-api/swagger-codegen/tree/v2.4.10)
158162
[2.4.9](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.9) | 2019-10-14 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.9](https://github.com/swagger-api/swagger-codegen/tree/v2.4.9)
159163
[2.4.8](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.8) | 2019-08-24 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.8](https://github.com/swagger-api/swagger-codegen/tree/v2.4.8)
@@ -173,18 +177,20 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
173177
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/2.0.17)
174178
1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)
175179

176-
177-
178180
### Prerequisites
179181
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
180182

181183
```sh
182-
wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.12/swagger-codegen-cli-2.4.12.jar -O swagger-codegen-cli.jar
184+
# Download current stable 2.x.x branch (Swagger and OpenAPI version 2)
185+
wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.13/swagger-codegen-cli-2.4.13.jar -O swagger-codegen-cli.jar
186+
187+
# Download current stable 3.x.x branch (OpenAPI version 3)
188+
wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.19/swagger-codegen-cli-3.0.19.jar -O swagger-codegen-cli.jar
183189

184190
java -jar swagger-codegen-cli.jar help
185191
```
186192

187-
For Windows users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. `Invoke-WebRequest -OutFile swagger-codegen-cli.jar http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.12/swagger-codegen-cli-2.4.12.jar`
193+
For Windows users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. `Invoke-WebRequest -OutFile swagger-codegen-cli.jar https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.13/swagger-codegen-cli-2.4.13.jar`
188194

189195
On a mac, it's even easier with `brew`:
190196
```sh
@@ -329,7 +335,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
329335
```
330336
(if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`)
331337

332-
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.12/swagger-codegen-cli-2.4.12.jar)
338+
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.13/swagger-codegen-cli-2.4.13.jar)
333339

334340
To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate`
335341

@@ -760,7 +766,7 @@ For example, to generate Ruby API client, simply send the following HTTP request
760766
```sh
761767
curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby
762768
```
763-
Then you will receieve a JSON response with the URL to download the zipped code.
769+
Then you will receive a JSON response with the URL to download the zipped code.
764770

765771
To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body:
766772
```json
@@ -911,6 +917,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
911917
- [MailMojo](https://mailmojo.no/)
912918
- [Metaswitch](https://www.metaswitch.com/)
913919
- [Mindera](http://mindera.com/)
920+
- [ModuleQ](https://moduleq.com)
914921
- [Mporium](http://mporium.com/)
915922
- [Neverfail](https://neverfail.com/)
916923
- [NexCap](http://www.nexess-solutions.com/fr/plateforme-iot/)

modules/swagger-codegen-cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.swagger</groupId>
55
<artifactId>swagger-codegen-project</artifactId>
6-
<version>2.4.13-SNAPSHOT</version>
6+
<version>2.4.14-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Generate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public void run() {
280280
}
281281

282282
if (skipAliasGeneration != null) {
283-
configurator.setSkipAliasGeneration(removeOperationIdPrefix);
283+
configurator.setSkipAliasGeneration(skipAliasGeneration);
284284
}
285285

286286
if (ignoreImportMappings != null) {

modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Meta.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.io.File;
1717
import java.io.IOException;
1818
import java.io.Reader;
19+
import java.nio.charset.StandardCharsets;
1920
import java.util.List;
2021
import java.util.Map;
2122

@@ -115,7 +116,7 @@ public File convert(SupportingFile support) {
115116
LOGGER.info("copying file to {}", outputFile.getAbsolutePath());
116117
}
117118

118-
FileUtils.writeStringToFile(outputFile, formatted);
119+
FileUtils.writeStringToFile(outputFile, formatted, StandardCharsets.UTF_8);
119120
return outputFile;
120121

121122
} catch (IOException e) {

modules/swagger-codegen-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.swagger</groupId>
66
<artifactId>swagger-codegen-project</artifactId>
7-
<version>2.4.13-SNAPSHOT</version>
7+
<version>2.4.14-SNAPSHOT</version>
88
<relativePath>../..</relativePath>
99
</parent>
1010
<artifactId>swagger-codegen-maven-plugin</artifactId>

modules/swagger-codegen/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.swagger</groupId>
55
<artifactId>swagger-codegen-project</artifactId>
6-
<version>2.4.13-SNAPSHOT</version>
6+
<version>2.4.14-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class CodegenModel {
4040

4141
public Set<String> imports = new TreeSet<String>();
4242
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, hasOptional, isArrayModel, hasChildren;
43+
public CodegenProperty parentContainer;
4344
public boolean hasOnlyReadOnly = true; // true if all properties are read-only
4445
public ExternalDocs externalDocs;
4546

modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class CodegenProperty implements Cloneable {
4646
public List<String> _enum;
4747
public Map<String, Object> allowableValues;
4848
public CodegenProperty items;
49+
public Integer itemsDepth;
4950
public Map<String, Object> vendorExtensions;
5051
public boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template)
5152
public boolean isInherited;

modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import javax.annotation.Nullable;
44
import java.io.File;
5+
import java.io.UnsupportedEncodingException;
6+
import java.net.URLDecoder;
7+
import java.nio.charset.StandardCharsets;
58
import java.util.*;
69
import java.util.Map.Entry;
710
import java.util.regex.Matcher;
@@ -1604,12 +1607,24 @@ public String getterAndSetterCapitalize(String name) {
16041607
* @return Codegen Property object
16051608
*/
16061609
public CodegenProperty fromProperty(String name, Property p) {
1610+
return fromProperty(name, p, null);
1611+
}
1612+
/**
1613+
* Convert Swagger Property object to Codegen Property object
1614+
*
1615+
* @param name name of the property
1616+
* @param p Swagger property object
1617+
* @param itemsDepth the depth in nested containers or null
1618+
* @return Codegen Property object
1619+
*/
1620+
private CodegenProperty fromProperty(String name, Property p, Integer itemsDepth) {
16071621
if (p == null) {
16081622
LOGGER.error("unexpected missing property for name " + name);
16091623
return null;
16101624
}
16111625

16121626
CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY);
1627+
property.itemsDepth = itemsDepth;
16131628
property.name = toVarName(name);
16141629
property.baseName = name;
16151630
property.nameInCamelCase = camelize(property.name, false);
@@ -1872,7 +1887,8 @@ public CodegenProperty fromProperty(String name, Property p) {
18721887
if (itemName == null) {
18731888
itemName = property.name;
18741889
}
1875-
CodegenProperty cp = fromProperty(itemName, ap.getItems());
1890+
CodegenProperty cp = fromProperty(itemName, ap.getItems(),
1891+
itemsDepth == null ? 1 : itemsDepth.intValue() + 1);
18761892
updatePropertyForArray(property, cp);
18771893
} else if (p instanceof MapProperty) {
18781894
MapProperty ap = (MapProperty) p;
@@ -1885,7 +1901,8 @@ public CodegenProperty fromProperty(String name, Property p) {
18851901
property.maxItems = ap.getMaxProperties();
18861902

18871903
// handle inner property
1888-
CodegenProperty cp = fromProperty("inner", ap.getAdditionalProperties());
1904+
CodegenProperty cp = fromProperty("inner", ap.getAdditionalProperties(),
1905+
itemsDepth == null ? 1 : itemsDepth.intValue() + 1);
18891906
updatePropertyForMap(property, cp);
18901907
} else {
18911908
setNonArrayMapProperty(property, type);
@@ -2717,6 +2734,11 @@ public CodegenParameter fromParameter(Parameter param, Set<String> imports) {
27172734
Model sub = bp.getSchema();
27182735
if (sub instanceof RefModel) {
27192736
String name = ((RefModel) sub).getSimpleRef();
2737+
try {
2738+
name = URLDecoder.decode(name, StandardCharsets.UTF_8.name());
2739+
} catch (UnsupportedEncodingException e) {
2740+
LOGGER.error("Could not decoded string: " + name, e);
2741+
}
27202742
name = getAlias(name);
27212743
if (typeMapping.containsKey(name)) {
27222744
name = typeMapping.get(name);
@@ -3088,10 +3110,10 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera
30883110
}
30893111

30903112
private void addParentContainer(CodegenModel m, String name, Property property) {
3091-
final CodegenProperty tmp = fromProperty(name, property);
3092-
addImport(m, tmp.complexType);
3113+
m.parentContainer = fromProperty(name, property);
3114+
addImport(m, m.parentContainer.complexType);
30933115
m.parent = toInstantiationType(property);
3094-
final String containerType = tmp.containerType;
3116+
final String containerType = m.parentContainer.containerType;
30953117
final String instantiationType = instantiationTypes.get(containerType);
30963118
if (instantiationType != null) {
30973119
addImport(m, instantiationType);
@@ -3981,4 +4003,14 @@ public void setIgnoreImportMapping(boolean ignoreImportMapping) {
39814003
public boolean defaultIgnoreImportMappingOption() {
39824004
return false;
39834005
}
4006+
4007+
protected boolean isModelObject(ModelImpl model) {
4008+
if ("object".equalsIgnoreCase(model.getType())) {
4009+
return true;
4010+
}
4011+
if ((StringUtils.EMPTY.equalsIgnoreCase(model.getType()) || model.getType() == null) && (model.getProperties() != null && !model.getProperties().isEmpty())) {
4012+
return true;
4013+
}
4014+
return false;
4015+
}
39844016
}

modules/swagger-codegen/src/main/java/io/swagger/codegen/MetaGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.io.File;
1515
import java.io.IOException;
1616
import java.io.Reader;
17+
import java.nio.charset.StandardCharsets;
1718
import java.util.ArrayList;
1819
import java.util.HashMap;
1920
import java.util.List;
@@ -166,7 +167,7 @@ public Reader getTemplate(String name) {
166167
files.add(new File(outputFilename));
167168
} else {
168169
String template = readTemplate(templateDir + File.separator + support.templateFile);
169-
FileUtils.writeStringToFile(new File(outputFilename), template);
170+
FileUtils.writeStringToFile(new File(outputFilename), template, StandardCharsets.UTF_8);
170171
LOGGER.info("copying file to " + outputFilename);
171172
files.add(new File(outputFilename));
172173
}

0 commit comments

Comments
 (0)