Skip to content

Commit 6cfd272

Browse files
authored
Merge pull request #50 from CyberSource/validations
Removed validation for maxLength and minLength
2 parents 6878bc4 + 1fdde35 commit 6cfd272

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

generator/cybersource-ruby-template/partial_model_generic.mustache

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,6 @@
9494

9595
{{/required}}
9696
{{#hasValidation}}
97-
{{#maxLength}}
98-
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length > {{{maxLength}}}
99-
invalid_properties.push('invalid value for "{{{name}}}", the character length must be smaller than or equal to {{{maxLength}}}.')
100-
end
101-
102-
{{/maxLength}}
103-
{{#minLength}}
104-
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length < {{{minLength}}}
105-
invalid_properties.push('invalid value for "{{{name}}}", the character length must be great than or equal to {{{minLength}}}.')
106-
end
107-
108-
{{/minLength}}
10997
{{#maximum}}
11098
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
11199
invalid_properties.push('invalid value for "{{{name}}}", must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.')
@@ -155,12 +143,6 @@
155143
{{/isContainer}}
156144
{{/isEnum}}
157145
{{#hasValidation}}
158-
{{#maxLength}}
159-
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length > {{{maxLength}}}
160-
{{/maxLength}}
161-
{{#minLength}}
162-
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length < {{{minLength}}}
163-
{{/minLength}}
164146
{{#maximum}}
165147
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
166148
{{/maximum}}
@@ -207,18 +189,6 @@
207189
end
208190

209191
{{/required}}
210-
{{#maxLength}}
211-
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.to_s.length > {{{maxLength}}}
212-
fail ArgumentError, 'invalid value for "{{{name}}}", the character length must be smaller than or equal to {{{maxLength}}}.'
213-
end
214-
215-
{{/maxLength}}
216-
{{#minLength}}
217-
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.to_s.length < {{{minLength}}}
218-
fail ArgumentError, 'invalid value for "{{{name}}}", the character length must be great than or equal to {{{minLength}}}.'
219-
end
220-
221-
{{/minLength}}
222192
{{#maximum}}
223193
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
224194
fail ArgumentError, 'invalid value for "{{{name}}}", must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.'

0 commit comments

Comments
 (0)