-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Regex param validation not working as expected in Ruby-Client #1392
Labels
Milestone
Comments
@ggershoni thanks for the PR, which has been merged into master. |
A-Joshi
pushed a commit
to ihsmarkitoss/openapi-generator
that referenced
this issue
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
5 tasks
This was referenced Jan 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
We are using a \d in our regex to ensure pattern has only digits but this is turned into \d and Ruby can't interpret it correctly.
In OpenAPI v3 file:
pattern: '^\d{10}$'
Generated validation code:
Regexp.new(/^\\d{10}$/)
Should be:
Regexp.new(/^\d{10}$/)
openapi-generator version
Was using latest stable version (3.3.2) and also grabbed and build latest from master.
OpenAPI declaration file content or url
Command line used for generation
docker run --rm -v ${PWD}:/local -v ${PWD}/../openapi/$(OPENAPI_FILENAME):/source/openapi-v3.yaml openapitools/openapi-generator-cli generate -i /source/openapi-v3.yaml -g ruby -o /local/out/ruby-client
Steps to reproduce
Following code is raising exception:
Related issues/PRs
Suggest a fix/enhancement
Have PR with fix.
The text was updated successfully, but these errors were encountered: