Skip to content

Commit 8a3c2e7

Browse files
committed
fix python flask to handle comment block
1 parent 2464633 commit 8a3c2e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,16 @@ public String toOperationId(String operationId) {
336336
// addPet => add_pet
337337
return underscore(operationId);
338338
}
339+
340+
@Override
341+
public String escapeQuotationMark(String input) {
342+
// remove ' to avoid code injection
343+
return input.replace("'", "");
344+
}
345+
346+
@Override
347+
public String escapeUnsafeCharacters(String input) {
348+
// remove multiline comment
349+
return input.replace("'''", "'_'_'");
350+
}
339351
}

0 commit comments

Comments
 (0)