Fixed the compile time error in the generated code caused due to unescaped new line characters.

Since the description text is not being escaped, if there is a new line character, it will cause a new line to be added to the source code. This can cause compile time error if the new line character is part of a string (e.g. java string) and there is no '+' sign explicitly added to the code. Note: The code was doing escapeText for properties but not for models. This patch fixes that.
This commit is contained in:
Sunny Gupta
2015-04-01 12:33:44 -07:00
parent 64292cdc9b
commit 80259fbcc4

View File

@@ -406,7 +406,7 @@ public class DefaultCodegen {
m.name = escapeReservedWord(name);
else
m.name = name;
m.description = model.getDescription();
m.description = escapeText(model.getDescription());
m.classname = toModelName(name);
m.classVarName = toVarName(name);
m.modelJson = Json.pretty(model);