Skip to content

Commit 4be1145

Browse files
committed
Merge branch 'patch-1' of https://github.com/ircecho/swagger-codegen into ircecho-patch-1
2 parents a07d602 + 66619b1 commit 4be1145

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/swagger-codegen/src/main/resources/ruby/partial_model_generic.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@
124124
return false if @{{{name}}}.nil?
125125
{{/required}}
126126
{{#isEnum}}
127+
{{^isContainer}}
127128
{{{name}}}_validator = EnumAttributeValidator.new('{{{datatype}}}', [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}])
128129
return false unless {{{name}}}_validator.valid?(@{{{name}}})
130+
{{/isContainer}}
129131
{{/isEnum}}
130132
{{#hasValidation}}
131133
{{#minLength}}
@@ -150,6 +152,7 @@
150152

151153
{{#vars}}
152154
{{#isEnum}}
155+
{{^isContainer}}
153156
# Custom attribute writer method checking allowed values (enum).
154157
# @param [Object] {{{name}}} Object to be assigned
155158
def {{{name}}}=({{{name}}})
@@ -160,6 +163,7 @@
160163
@{{{name}}} = {{{name}}}
161164
end
162165

166+
{{/isContainer}}
163167
{{/isEnum}}
164168
{{^isEnum}}
165169
{{#hasValidation}}

0 commit comments

Comments
 (0)