forked from loafle/openapi-generator-original
refactor abstract scala codegen (#7334)
This commit is contained in:
parent
a85162fe33
commit
f7779c545e
@ -211,4 +211,10 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
|
|||||||
int lastIndexOfDot = input.lastIndexOf(".");
|
int lastIndexOfDot = input.lastIndexOf(".");
|
||||||
return input.substring(lastIndexOfDot + 1);
|
return input.substring(lastIndexOfDot + 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
public String escapeQuotationMark(String input) {
|
||||||
|
// remove " to avoid code injection
|
||||||
|
return input.replace("\"", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -235,10 +235,4 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC
|
|||||||
return formatIdentifier(stripPackageName(property.baseName), true);
|
return formatIdentifier(stripPackageName(property.baseName), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeQuotationMark(String input) {
|
|
||||||
// remove " to avoid code injection
|
|
||||||
return input.replace("\"", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -218,12 +218,6 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod
|
|||||||
return camelizedName;
|
return camelizedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeQuotationMark(String input) {
|
|
||||||
// remove " to avoid code injection
|
|
||||||
return input.replace("\"", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {
|
public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {
|
||||||
objs = super.postProcessModelsEnum(objs);
|
objs = super.postProcessModelsEnum(objs);
|
||||||
|
@ -151,11 +151,4 @@ public class ScalatraServerCodegen extends AbstractScalaCodegen implements Codeg
|
|||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeQuotationMark(String input) {
|
|
||||||
// remove " to avoid code injection
|
|
||||||
return input.replace("\"", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -235,12 +235,6 @@ public class ScalazClientCodegen extends AbstractScalaCodegen implements Codegen
|
|||||||
public abstract String formatFragment(String fragment);
|
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 {
|
private class EnumEntryLambda extends CustomLambda {
|
||||||
@Override
|
@Override
|
||||||
public String formatFragment(String fragment) {
|
public String formatFragment(String fragment) {
|
||||||
|
@ -1 +1 @@
|
|||||||
2.3.0
|
2.4.0-SNAPSHOT
|
||||||
|
@ -340,6 +340,7 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
|
|||||||
val headerParams = new mutable.HashMap[String, String]
|
val headerParams = new mutable.HashMap[String, String]
|
||||||
|
|
||||||
if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus")
|
if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus")
|
||||||
|
|
||||||
queryParams += "status" -> status.toString
|
queryParams += "status" -> status.toString
|
||||||
|
|
||||||
val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "")
|
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]
|
val headerParams = new mutable.HashMap[String, String]
|
||||||
|
|
||||||
if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags")
|
if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags")
|
||||||
|
|
||||||
queryParams += "tags" -> tags.toString
|
queryParams += "tags" -> tags.toString
|
||||||
|
|
||||||
val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "")
|
val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user