refactor abstract scala codegen (#7334)

This commit is contained in:
William Cheng 2018-01-08 00:20:38 +08:00 committed by GitHub
parent a85162fe33
commit f7779c545e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 27 deletions

View File

@ -211,4 +211,10 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
int lastIndexOfDot = input.lastIndexOf(".");
return input.substring(lastIndexOfDot + 1);
}
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
}

View File

@ -235,10 +235,4 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC
return formatIdentifier(stripPackageName(property.baseName), true);
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
}

View File

@ -218,12 +218,6 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod
return camelizedName;
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {
objs = super.postProcessModelsEnum(objs);

View File

@ -151,11 +151,4 @@ public class ScalatraServerCodegen extends AbstractScalaCodegen implements Codeg
return objs;
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
}

View File

@ -235,12 +235,6 @@ public class ScalazClientCodegen extends AbstractScalaCodegen implements Codegen
public abstract String formatFragment(String fragment);
}
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
private class EnumEntryLambda extends CustomLambda {
@Override
public String formatFragment(String fragment) {

View File

@ -1 +1 @@
2.3.0
2.4.0-SNAPSHOT

View File

@ -340,6 +340,7 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
val headerParams = new mutable.HashMap[String, String]
if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus")
queryParams += "status" -> status.toString
val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "")
@ -357,6 +358,7 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
val headerParams = new mutable.HashMap[String, String]
if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags")
queryParams += "tags" -> tags.toString
val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "")