diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java index 612d7f37e89..2779a09386a 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java @@ -688,10 +688,8 @@ public void postProcessPattern(String pattern, Map vendorExtensi if(pattern != null) { int i = pattern.lastIndexOf('/'); - //Must follow Perl /pattern/modifiers convention if(pattern.charAt(0) != '/' || i < 2) { - throw new IllegalArgumentException("Pattern must follow the Perl " - + "/pattern/modifiers convention. "+pattern+" is not valid."); + pattern = String.format("/%s/", pattern); } String regex = pattern.substring(1, i).replace("'", "\\'"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java index 7a8149a6e78..f5f5e63466b 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java @@ -265,10 +265,8 @@ public void postProcessPattern(String pattern, Map vendorExtensi if(pattern != null) { int i = pattern.lastIndexOf('/'); - //Must follow Perl /pattern/modifiers convention if(pattern.charAt(0) != '/' || i < 2) { - throw new IllegalArgumentException("Pattern must follow the Perl " - + "/pattern/modifiers convention. "+pattern+" is not valid."); + pattern = String.format("/%s/", pattern); } String regex = pattern.substring(1, i).replace("'", "\\'");