Skip to content

Commit 9c56bb6

Browse files
lwanderwing328
authored andcommitted
[Java] Escape descriptions in javadocs (#6040)
The [java8 doclint](http://openjdk.java.net/jeps/172) rejects unescaped HTML chars such as `<`, making some generated clients unbuildable with java8. Seems a few property descriptions were using the `{{{` instead of `{{` preventing those HTML chars from being escaped properly.
1 parent b024d86 commit 9c56bb6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import com.google.gson.stream.JsonWriter;
1111
{{/gson}}
1212

1313
/**
14-
* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
14+
* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
1515
*/
1616
{{#gson}}
1717
@JsonAdapter({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class)

modules/swagger-codegen/src/main/resources/Java/pojo.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
8080
{{/isReadOnly}}
8181
/**
8282
{{#description}}
83-
* {{{description}}}
83+
* {{description}}
8484
{{/description}}
8585
{{^description}}
8686
* Get {{name}}

samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public ModelReturn _return(Integer _return) {
3838
}
3939

4040
/**
41-
* property description *_/ ' \" =end -- \\r\\n \\n \\r
41+
* property description *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
4242
* @return _return
4343
**/
4444
@ApiModelProperty(value = "property description *_/ ' \" =end -- \\r\\n \\n \\r")

0 commit comments

Comments
 (0)