forked from loafle/openapi-generator-original
Merge branch 'patch-1' of https://github.com/ircecho/swagger-codegen into ircecho-patch-1
This commit is contained in:
commit
3ae0ffa819
@ -124,8 +124,10 @@
|
|||||||
return false if @{{{name}}}.nil?
|
return false if @{{{name}}}.nil?
|
||||||
{{/required}}
|
{{/required}}
|
||||||
{{#isEnum}}
|
{{#isEnum}}
|
||||||
|
{{^isContainer}}
|
||||||
{{{name}}}_validator = EnumAttributeValidator.new('{{{datatype}}}', [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}])
|
{{{name}}}_validator = EnumAttributeValidator.new('{{{datatype}}}', [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}])
|
||||||
return false unless {{{name}}}_validator.valid?(@{{{name}}})
|
return false unless {{{name}}}_validator.valid?(@{{{name}}})
|
||||||
|
{{/isContainer}}
|
||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{#hasValidation}}
|
{{#hasValidation}}
|
||||||
{{#minLength}}
|
{{#minLength}}
|
||||||
@ -150,6 +152,7 @@
|
|||||||
|
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
{{#isEnum}}
|
{{#isEnum}}
|
||||||
|
{{^isContainer}}
|
||||||
# Custom attribute writer method checking allowed values (enum).
|
# Custom attribute writer method checking allowed values (enum).
|
||||||
# @param [Object] {{{name}}} Object to be assigned
|
# @param [Object] {{{name}}} Object to be assigned
|
||||||
def {{{name}}}=({{{name}}})
|
def {{{name}}}=({{{name}}})
|
||||||
@ -160,6 +163,7 @@
|
|||||||
@{{{name}}} = {{{name}}}
|
@{{{name}}} = {{{name}}}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
{{/isContainer}}
|
||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{^isEnum}}
|
{{^isEnum}}
|
||||||
{{#hasValidation}}
|
{{#hasValidation}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user