remove logger, fix deserialization of json response

This commit is contained in:
wing328
2015-12-21 21:19:12 +08:00
parent 3ebefba678
commit 4062deed92
13 changed files with 351 additions and 758 deletions

View File

@@ -1045,8 +1045,6 @@ public class DefaultCodegen {
}
property.baseType = getSwaggerType(p);
LOGGER.info("property.baseType=" + property.baseType);
LOGGER.info("property.datatype=" + property.datatype);
if (p instanceof ArrayProperty) {
property.isContainer = true;

View File

@@ -657,7 +657,6 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
for (String nextImport : allImports) {
Map<String, String> im = new LinkedHashMap<String, String>();
String mapping = config.importMapping().get(nextImport);
LOGGER.info("mapping = " + mapping);
if (mapping == null) {
mapping = config.toModelImport(nextImport);
}
@@ -704,7 +703,6 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
List<Map<String, String>> imports = new ArrayList<Map<String, String>>();
for (String nextImport : allImports) {
LOGGER.info("nextImport=" + nextImport);
Map<String, String> im = new LinkedHashMap<String, String>();
String mapping = config.importMapping().get(nextImport);
if (mapping == null) {
@@ -713,14 +711,12 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
if (mapping != null && !config.defaultIncludes().contains(mapping)) {
im.put("import", mapping);
imports.add(im);
LOGGER.info("config.importMaping added " + mapping);
}
// add instantiation types
mapping = config.instantiationTypes().get(nextImport);
if (mapping != null && !config.defaultIncludes().contains(mapping)) {
im.put("import", mapping);
imports.add(im);
LOGGER.info("config.instantiationTypes added " + mapping);
}
}

View File

@@ -128,8 +128,8 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
return name;
// camelize (lower first character) the variable name
// pet_id => petId
name = camelize(name, true);
// pet_id => PetId
name = camelize(name);
// for reserved word or word starting with number, append _
if(reservedWords.contains(name) || name.matches("^\\d.*"))
@@ -163,7 +163,7 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public String getTypeDeclaration(Property p) {
LOGGER.info("getTypeDeclaration=" + p.getName());
String swaggerType = getSwaggerType(p);
if(p instanceof ArrayProperty) {
ArrayProperty ap = (ArrayProperty) p;
Property inner = ap.getItems();
@@ -175,14 +175,6 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
return getSwaggerType(p) + "[string]" + getTypeDeclaration(inner);
}
LOGGER.info("super.getTypeDeclaration=" + super.getTypeDeclaration(p));
return super.getTypeDeclaration(p);
}
@Override
public String getSwaggerType(Property p) {
String swaggerType = super.getSwaggerType(p);
LOGGER.info("swaggerType=" + swaggerType);
String type = null;
if(typeMapping.containsKey(swaggerType)) {
type = typeMapping.get(swaggerType);
@@ -200,7 +192,7 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
if(reservedWords.contains(operationId))
throw new RuntimeException(operationId + " (reserved word) cannot be used as method name");
return camelize(operationId, true);
return camelize(operationId);
}
@Override