Skip to content

Commit 458946d

Browse files
committed
Removed validation of maximum, minimum, maxItems, minItems
1 parent 46a6350 commit 458946d

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

generator/cybersource-ruby-template/partial_model_generic.mustache

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -94,36 +94,12 @@
9494

9595
{{/required}}
9696
{{#hasValidation}}
97-
{{#maximum}}
98-
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
99-
invalid_properties.push('invalid value for "{{{name}}}", must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.')
100-
end
101-
102-
{{/maximum}}
103-
{{#minimum}}
104-
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}}
105-
invalid_properties.push('invalid value for "{{{name}}}", must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}.')
106-
end
107-
108-
{{/minimum}}
10997
{{#pattern}}
11098
#if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} !~ Regexp.new({{{pattern}}})
11199
#invalid_properties.push('invalid value for "{{{name}}}", must conform to the pattern {{{pattern}}}.')
112100
#end
113101

114102
{{/pattern}}
115-
{{#maxItems}}
116-
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length > {{{maxItems}}}
117-
invalid_properties.push('invalid value for "{{{name}}}", number of items must be less than or equal to {{{maxItems}}}.'
118-
end
119-
120-
{{/maxItems}}
121-
{{#minItems}}
122-
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length < {{{minItems}}}
123-
invalid_properties.push('invalid value for "{{{name}}}", number of items must be greater than or equal to {{{minItems}}}.'
124-
end
125-
126-
{{/minItems}}
127103
{{/hasValidation}}
128104
{{/vars}}
129105
invalid_properties
@@ -143,21 +119,9 @@
143119
{{/isContainer}}
144120
{{/isEnum}}
145121
{{#hasValidation}}
146-
{{#maximum}}
147-
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
148-
{{/maximum}}
149-
{{#minimum}}
150-
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}}
151-
{{/minimum}}
152122
{{#pattern}}
153123
#return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} !~ Regexp.new({{{pattern}}})
154124
{{/pattern}}
155-
{{#maxItems}}
156-
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length > {{{maxItems}}}
157-
{{/maxItems}}
158-
{{#minItems}}
159-
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length < {{{minItems}}}
160-
{{/minItems}}
161125
{{/hasValidation}}
162126
{{/vars}}
163127
true
@@ -189,36 +153,12 @@
189153
end
190154

191155
{{/required}}
192-
{{#maximum}}
193-
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
194-
fail ArgumentError, 'invalid value for "{{{name}}}", must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.'
195-
end
196-
197-
{{/maximum}}
198-
{{#minimum}}
199-
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}}
200-
fail ArgumentError, 'invalid value for "{{{name}}}", must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}.'
201-
end
202-
203-
{{/minimum}}
204156
{{#pattern}}
205157
#if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} !~ Regexp.new({{{pattern}}})
206158
#fail ArgumentError, 'invalid value for "{{{name}}}", must conform to the pattern {{{pattern}}}.'
207159
#end
208160

209161
{{/pattern}}
210-
{{#maxItems}}
211-
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.length > {{{maxItems}}}
212-
fail ArgumentError, 'invalid value for "{{{name}}}", number of items must be less than or equal to {{{maxItems}}}.'
213-
end
214-
215-
{{/maxItems}}
216-
{{#minItems}}
217-
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.length < {{{minItems}}}
218-
fail ArgumentError, 'invalid value for "{{{name}}}", number of items must be greater than or equal to {{{minItems}}}.'
219-
end
220-
221-
{{/minItems}}
222162
@{{{name}}} = {{{name}}}
223163
end
224164

0 commit comments

Comments
 (0)