Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regex generated in Ruby client #1393

Merged
merged 2 commits into from
Nov 7, 2018
Merged

Fix regex generated in Ruby client #1393

merged 2 commits into from
Nov 7, 2018

Conversation

ggershoni
Copy link
Contributor

@ggershoni ggershoni commented Nov 6, 2018

Please see #1392 for details

Note: I needed to update autotest-fsevent (0.2.13) to autotest-fsevent (0.2.14) in Gemfile.lock to make rspec work on macOS.

Would love your thoughts/advice @cliffano @zlx.

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

In AbstractRubyCodegen overloaded public String toRegularExpression(String pattern) from DefaultCodegen. Am not escaping the pattern (so no extra \ added) since the regex pattern is run inside regex delimiters already.

Added tests in both Java and Ruby client code.

…recognizing \d correctly in Ruby client.
@@ -13,7 +13,7 @@ GEM
public_suffix (>= 2.0.2, < 4.0)
autotest (4.4.6)
ZenTest (>= 4.4.1)
autotest-fsevent (0.2.13)
autotest-fsevent (0.2.14)
Copy link
Contributor Author

@ggershoni ggershoni Nov 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated from 0.2.13 to 0.2.14 because doing a bundle install with 0.2.13 was getting:

Darwin 18 is not (yet) supported (RuntimeError)

upgrading to 0.2.14 fixed issue.

@wing328
Copy link
Member

wing328 commented Nov 7, 2018

@ggershoni the fix looks good to me and it's perfectly fine to update the dependencies. Thanks for your contribution.

@wing328 wing328 merged commit 0e2e1bf into OpenAPITools:master Nov 7, 2018
@wing328 wing328 changed the title Added tests and fix for issue #1392. Fix regex generated in Ruby client. Fix regex generated in Ruby client Nov 14, 2018
@wing328
Copy link
Member

wing328 commented Nov 15, 2018

@ggershoni thanks for the PR, which has been included in the v3.3.3 release: https://twitter.com/oas_generator/status/1062929948191510528

@ggershoni
Copy link
Contributor Author

Woohoo! Thanks heaps @wing328 :-)

A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
…in Ruby client. (OpenAPITools#1393)

* Added tests and fix for issue OpenAPITools#1392. Param validation with regex not recognizing \d correctly in Ruby client.

* Added generated files to pass ./bin/utils/ensure-up-to-date which is run by circleci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants