Skip to content

Commit

Permalink
Merge pull request #826 from swagger-api/issue-652
Browse files Browse the repository at this point in the history
apply perl pattern to regex without it for csharp and python generators
  • Loading branch information
HugoMario authored Dec 17, 2020
2 parents e0cceed + 0c78f38 commit 1e903c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ public void postProcessPattern(String pattern, Map<String, Object> vendorExtensi

//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);;
i = pattern.lastIndexOf('/');
}

String regex = pattern.substring(1, i).replace("'", "\'");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ public void postProcessPattern(String pattern, Map<String, Object> vendorExtensi

//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);;
i = pattern.lastIndexOf('/');
}

String regex = pattern.substring(1, i).replace("'", "\\'");
Expand Down

0 comments on commit 1e903c8

Please sign in to comment.