Fix #3400 - incorrect MinLength and MaxLength on partial_model_generic.mustache template (#3415)

* fix maxLength and Regexp issue

* more fix

* revert some changes
This commit is contained in:
Andy 2016-07-20 01:52:07 -07:00 committed by wing328
parent 97855baf83
commit dfe4944552
2 changed files with 9 additions and 9 deletions

View File

@ -130,12 +130,12 @@
{{/isContainer}}
{{/isEnum}}
{{#hasValidation}}
{{#minLength}}
return false if @{{{name}}}.to_s.length > {{{maxLength}}}
{{/minLength}}
{{#maxLength}}
return false if @{{{name}}}.to_s.length < {{{minLength}}}
return false if @{{{name}}}.to_s.length > {{{maxLength}}}
{{/maxLength}}
{{#minLength}}
return false if @{{{name}}}.to_s.length < {{{minLength}}}
{{/minLength}}
{{#maximum}}
return false if @{{{name}}} > {{{maximum}}}
{{/maximum}}
@ -174,18 +174,18 @@
fail ArgumentError, "{{{name}}} cannot be nil"
end
{{#minLength}}
{{#maxLength}}
if {{{name}}}.to_s.length > {{{maxLength}}}
fail ArgumentError, "invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}."
end
{{/minLength}}
{{#maxLength}}
{{/maxLength}}
{{#minLength}}
if {{{name}}}.to_s.length < {{{minLength}}}
fail ArgumentError, "invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}."
end
{{/maxLength}}
{{/minLength}}
{{#maximum}}
if {{{name}}} > {{{maximum}}}
fail ArgumentError, "invalid value for '{{{name}}}', must be smaller than or equal to {{{maximum}}}."

View File

@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-07-19T15:06:57.795+08:00
- Build date: 2016-07-19T11:36:39.517-07:00
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
## Installation