forked from loafle/openapi-generator-original
Runs ensure up to date (#7622)
This commit is contained in:
parent
1c3d6e5e6f
commit
bbf9c30c7a
@ -97,7 +97,9 @@ module Petstore
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
super(attributes)
|
||||
self.class.openapi_types.each_pair do |key, type|
|
||||
if type =~ /\AArray<(.*)>/i
|
||||
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||
self.send("#{key}=", nil)
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||
@ -105,8 +107,6 @@ module Petstore
|
||||
end
|
||||
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||
self.send("#{key}=", nil)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -93,7 +93,9 @@ module Petstore
|
||||
def build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
self.class.openapi_types.each_pair do |key, type|
|
||||
if type =~ /\AArray<(.*)>/i
|
||||
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||
self.send("#{key}=", nil)
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||
@ -101,8 +103,6 @@ module Petstore
|
||||
end
|
||||
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||
self.send("#{key}=", nil)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user