forked from loafle/openapi-generator-original
ruby: Fix syntax error when pattern contains a single quote
This commit is contained in:
parent
b909252bb8
commit
6bb0ea2e8a
@ -82,7 +82,7 @@ module {{moduleName}}
|
||||
{{/minimum}}
|
||||
{{#pattern}}
|
||||
if {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} !~ Regexp.new({{{pattern}}})
|
||||
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}.'
|
||||
fail ArgumentError, "invalid value for '{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:\"{{{paramName}}}\"]{{/required}}' when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."
|
||||
end
|
||||
|
||||
{{/pattern}}
|
||||
|
@ -154,7 +154,7 @@ module Petstore
|
||||
# verify the required parameter 'pattern_without_delimiter' is set
|
||||
fail ArgumentError, "Missing the required parameter 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters" if pattern_without_delimiter.nil?
|
||||
if pattern_without_delimiter !~ Regexp.new(/^[A-Z].*/)
|
||||
fail ArgumentError, 'invalid value for "pattern_without_delimiter" when calling FakeApi.test_endpoint_parameters, must conform to the pattern /^[A-Z].*/.'
|
||||
fail ArgumentError, "invalid value for 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters, must conform to the pattern /^[A-Z].*/."
|
||||
end
|
||||
|
||||
# verify the required parameter 'byte' is set
|
||||
@ -180,7 +180,7 @@ module Petstore
|
||||
end
|
||||
|
||||
if !opts[:'string'].nil? && opts[:'string'] !~ Regexp.new(/[a-z]/i)
|
||||
fail ArgumentError, 'invalid value for "opts[:"string"]" when calling FakeApi.test_endpoint_parameters, must conform to the pattern /[a-z]/i.'
|
||||
fail ArgumentError, "invalid value for 'opts[:\"string\"]' when calling FakeApi.test_endpoint_parameters, must conform to the pattern /[a-z]/i."
|
||||
end
|
||||
|
||||
if !opts[:'password'].nil? && opts[:'password'].to_s.length > 64
|
||||
|
Loading…
x
Reference in New Issue
Block a user