forked from loafle/openapi-generator-original
cleanup build error due to missing CodegenConfig configuration entry
#1294
This commit is contained in:
parent
637b9937a8
commit
34fb2c561f
@ -588,39 +588,39 @@ public class DefaultCodegen {
|
|||||||
*/
|
*/
|
||||||
public String toDefaultValueWithParam(String name, Property p) {
|
public String toDefaultValueWithParam(String name, Property p) {
|
||||||
if (p instanceof StringProperty) {
|
if (p instanceof StringProperty) {
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
} else if (p instanceof BooleanProperty) {
|
} else if (p instanceof BooleanProperty) {
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
} else if (p instanceof DateProperty) {
|
} else if (p instanceof DateProperty) {
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
} else if (p instanceof DateTimeProperty) {
|
} else if (p instanceof DateTimeProperty) {
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
} else if (p instanceof DoubleProperty) {
|
} else if (p instanceof DoubleProperty) {
|
||||||
DoubleProperty dp = (DoubleProperty) p;
|
DoubleProperty dp = (DoubleProperty) p;
|
||||||
if (dp.getDefault() != null) {
|
if (dp.getDefault() != null) {
|
||||||
return dp.getDefault().toString();
|
return dp.getDefault().toString();
|
||||||
}
|
}
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
} else if (p instanceof FloatProperty) {
|
} else if (p instanceof FloatProperty) {
|
||||||
FloatProperty dp = (FloatProperty) p;
|
FloatProperty dp = (FloatProperty) p;
|
||||||
if (dp.getDefault() != null) {
|
if (dp.getDefault() != null) {
|
||||||
return dp.getDefault().toString();
|
return dp.getDefault().toString();
|
||||||
}
|
}
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
} else if (p instanceof IntegerProperty) {
|
} else if (p instanceof IntegerProperty) {
|
||||||
IntegerProperty dp = (IntegerProperty) p;
|
IntegerProperty dp = (IntegerProperty) p;
|
||||||
if (dp.getDefault() != null) {
|
if (dp.getDefault() != null) {
|
||||||
return dp.getDefault().toString();
|
return dp.getDefault().toString();
|
||||||
}
|
}
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
} else if (p instanceof LongProperty) {
|
} else if (p instanceof LongProperty) {
|
||||||
LongProperty dp = (LongProperty) p;
|
LongProperty dp = (LongProperty) p;
|
||||||
if (dp.getDefault() != null) {
|
if (dp.getDefault() != null) {
|
||||||
return dp.getDefault().toString();
|
return dp.getDefault().toString();
|
||||||
}
|
}
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
} else {
|
} else {
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,11 +334,13 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
if (p instanceof ArrayProperty) {
|
if (p instanceof ArrayProperty) {
|
||||||
final ArrayProperty ap = (ArrayProperty) p;
|
final ArrayProperty ap = (ArrayProperty) p;
|
||||||
final String pattern;
|
final String pattern;
|
||||||
if (fullJavaUtil) {
|
//if (fullJavaUtil) {
|
||||||
pattern = "new java.util.ArrayList<%s>()";
|
// pattern = "new ArrayList()";
|
||||||
} else {
|
//} else {
|
||||||
pattern = "new ArrayList<%s>()";
|
// pattern = "new ArrayList<%s>()";
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
pattern = "new Array()";
|
||||||
return String.format(pattern, getTypeDeclaration(ap.getItems()));
|
return String.format(pattern, getTypeDeclaration(ap.getItems()));
|
||||||
} else if (p instanceof MapProperty) {
|
} else if (p instanceof MapProperty) {
|
||||||
final MapProperty ap = (MapProperty) p;
|
final MapProperty ap = (MapProperty) p;
|
||||||
@ -376,17 +378,19 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
if (p instanceof ArrayProperty) {
|
if (p instanceof ArrayProperty) {
|
||||||
final ArrayProperty ap = (ArrayProperty) p;
|
final ArrayProperty ap = (ArrayProperty) p;
|
||||||
final String pattern;
|
final String pattern;
|
||||||
if (fullJavaUtil) {
|
// if (fullJavaUtil) {
|
||||||
pattern = "new java.util.ArrayList<%s>()";
|
// pattern = "new java.util.ArrayList<%s>()";
|
||||||
} else {
|
// } else {
|
||||||
pattern = "new ArrayList<%s>()" ;
|
// pattern = "new ArrayList<%s>()" ;
|
||||||
}
|
// }
|
||||||
|
pattern = " = new Array()" ;
|
||||||
|
|
||||||
return String.format(pattern, getTypeDeclaration(ap.getItems()))+ ";";
|
return String.format(pattern, getTypeDeclaration(ap.getItems()))+ ";";
|
||||||
} else if (p instanceof MapProperty) {
|
} else if (p instanceof MapProperty) {
|
||||||
final MapProperty ap = (MapProperty) p;
|
final MapProperty ap = (MapProperty) p;
|
||||||
final String pattern;
|
final String pattern;
|
||||||
if (fullJavaUtil) {
|
if (fullJavaUtil) {
|
||||||
pattern = "new java.util.HashMap<String, %s>()";
|
pattern = " = new java.util.HashMap<String, %s>()";
|
||||||
} else {
|
} else {
|
||||||
pattern = "new HashMap<String, %s>()";
|
pattern = "new HashMap<String, %s>()";
|
||||||
}
|
}
|
||||||
@ -394,14 +398,14 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
|
|
||||||
} else if (p instanceof LongProperty) {
|
} else if (p instanceof LongProperty) {
|
||||||
LongProperty dp = (LongProperty) p;
|
LongProperty dp = (LongProperty) p;
|
||||||
return "data." + name + ";";
|
return " = data." + name + ";";
|
||||||
|
|
||||||
// added for Javascript
|
// added for Javascript
|
||||||
} else if (p instanceof RefProperty) {
|
} else if (p instanceof RefProperty) {
|
||||||
RefProperty rp = (RefProperty)p;
|
RefProperty rp = (RefProperty)p;
|
||||||
System.out.println("rp: " + rp.getName() + rp.getAccess() + rp.getDescription() + rp.getExample() + rp.getFormat() + rp.getSimpleRef() + rp.getTitle() + rp.getType());
|
System.out.println("rp: " + rp.getName() + rp.getAccess() + rp.getDescription() + rp.getExample() + rp.getFormat() + rp.getSimpleRef() + rp.getTitle() + rp.getType());
|
||||||
|
|
||||||
return "new " +rp.getSimpleRef() + "(data." + name + ");";
|
return ".constructFromObject(data." + name + ");";
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("property: " + p);
|
System.out.println("property: " + p);
|
||||||
|
@ -26,7 +26,7 @@ function {{classname}}() {
|
|||||||
{{/required}}{{/allParams}}
|
{{/required}}{{/allParams}}
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
var {{localVariablePrefix}}path = '{{basePath}}' + replaceAll(replaceAll("{{{path}}}", "\\{format\\}","json"){{#pathParams}}
|
var {{localVariablePrefix}}path = '{{basePath}}' + replaceAll(replaceAll("{{{path}}}", "\\{format\\}","json"){{#pathParams}}
|
||||||
, "\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}});
|
, "\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString()){{/pathParams}});
|
||||||
|
|
||||||
var queryParams = {};
|
var queryParams = {};
|
||||||
var headerParams = {};
|
var headerParams = {};
|
||||||
|
@ -18,7 +18,7 @@ function {{classname}}() { {{#parent}}/* extends {{{parent}}}*/{{/parent}}
|
|||||||
|
|
||||||
self.constructFromObject = function(data) {
|
self.constructFromObject = function(data) {
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
self.{{name}} = {{{defaultValueWithParam}}}
|
self.{{name}}{{{defaultValueWithParam}}}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ io.swagger.codegen.languages.DartClientCodegen
|
|||||||
io.swagger.codegen.languages.FlashClientCodegen
|
io.swagger.codegen.languages.FlashClientCodegen
|
||||||
io.swagger.codegen.languages.FlaskConnexionCodegen
|
io.swagger.codegen.languages.FlaskConnexionCodegen
|
||||||
io.swagger.codegen.languages.JavaClientCodegen
|
io.swagger.codegen.languages.JavaClientCodegen
|
||||||
|
io.swagger.codegen.languages.JavascriptClientCodegen
|
||||||
io.swagger.codegen.languages.JaxRSServerCodegen
|
io.swagger.codegen.languages.JaxRSServerCodegen
|
||||||
io.swagger.codegen.languages.JavaInflectorServerCodegen
|
io.swagger.codegen.languages.JavaInflectorServerCodegen
|
||||||
io.swagger.codegen.languages.NodeJSServerCodegen
|
io.swagger.codegen.languages.NodeJSServerCodegen
|
||||||
|
Loading…
x
Reference in New Issue
Block a user