diff --git a/src/main/java/io/swagger/codegen/v3/generators/java/AbstractJavaCodegen.java b/src/main/java/io/swagger/codegen/v3/generators/java/AbstractJavaCodegen.java index 07aa3cf3f7..f434858dc5 100644 --- a/src/main/java/io/swagger/codegen/v3/generators/java/AbstractJavaCodegen.java +++ b/src/main/java/io/swagger/codegen/v3/generators/java/AbstractJavaCodegen.java @@ -1618,6 +1618,7 @@ public void setSupportJava6(boolean value) { this.supportJava6 = value; } + @Override public String toRegularExpression(String pattern) { return escapeText(pattern); } diff --git a/src/main/java/io/swagger/codegen/v3/generators/kotlin/AbstractKotlinCodegen.java b/src/main/java/io/swagger/codegen/v3/generators/kotlin/AbstractKotlinCodegen.java index d42ae0a90c..b4e156847f 100644 --- a/src/main/java/io/swagger/codegen/v3/generators/kotlin/AbstractKotlinCodegen.java +++ b/src/main/java/io/swagger/codegen/v3/generators/kotlin/AbstractKotlinCodegen.java @@ -523,6 +523,11 @@ public void addHandlebarHelpers(Handlebars handlebars) { handlebars.registerHelpers(ConditionalHelpers.class); } + @Override + public String toRegularExpression(String pattern) { + return escapeText(pattern); + } + /** * Provides a strongly typed declaration for simple arrays of some type and arrays of arrays of some type. *