Client: PHPClient: RubyIssue: Bughelp wanted
倉庫指標
- Star
- (12,701 star)
- PR 合併指標
- (30 天內沒有已合併 PR)
描述
Description
For this in YAML syntax:
pattern: '^a/b$'
...the PHP code generated is:
if (!preg_match("/^a/b$/", ...
...and for Ruby:
Regexp.new(/^a/b$/)
The problem with both is that the slash between a and b should be backslash escaped to avoid errors. I tried this in DefaultCodegen.addRegularExpressionDelimiter:
return "/" + pattern.replace("/", "\\/") + "/";
...but it makes no difference on the eventual output.
Swagger-codegen version
Current master