forked from loafle/openapi-generator-original
Fix ruby model generation with objects and additionalProperties (#6816)
* Fix model generation with objects and additionalProperties * Generate Ruby Petstore * Generate Ruby Security Petstore
This commit is contained in:
parent
4f3c86aa14
commit
f78d958ec0
@ -56,11 +56,16 @@
|
||||
|
||||
{{#vars}}
|
||||
if attributes.has_key?(:'{{{baseName}}}')
|
||||
{{#isContainer}}
|
||||
{{#isListContainer}}
|
||||
if (value = attributes[:'{{{baseName}}}']).is_a?(Array)
|
||||
self.{{{name}}} = value
|
||||
end
|
||||
{{/isContainer}}
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
if (value = attributes[:'{{{baseName}}}']).is_a?(Hash)
|
||||
self.{{{name}}} = value
|
||||
end
|
||||
{{/isMapContainer}}
|
||||
{{^isContainer}}
|
||||
self.{{{name}}} = attributes[:'{{{baseName}}}']
|
||||
{{/isContainer}}
|
||||
|
@ -45,13 +45,13 @@ module Petstore
|
||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||
|
||||
if attributes.has_key?(:'map_property')
|
||||
if (value = attributes[:'map_property']).is_a?(Array)
|
||||
if (value = attributes[:'map_property']).is_a?(Hash)
|
||||
self.map_property = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.has_key?(:'map_of_map_property')
|
||||
if (value = attributes[:'map_of_map_property']).is_a?(Array)
|
||||
if (value = attributes[:'map_of_map_property']).is_a?(Hash)
|
||||
self.map_of_map_property = value
|
||||
end
|
||||
end
|
||||
|
@ -66,13 +66,13 @@ module Petstore
|
||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||
|
||||
if attributes.has_key?(:'map_map_of_string')
|
||||
if (value = attributes[:'map_map_of_string']).is_a?(Array)
|
||||
if (value = attributes[:'map_map_of_string']).is_a?(Hash)
|
||||
self.map_map_of_string = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.has_key?(:'map_of_enum_string')
|
||||
if (value = attributes[:'map_of_enum_string']).is_a?(Array)
|
||||
if (value = attributes[:'map_of_enum_string']).is_a?(Hash)
|
||||
self.map_of_enum_string = value
|
||||
end
|
||||
end
|
||||
|
@ -57,7 +57,7 @@ module Petstore
|
||||
end
|
||||
|
||||
if attributes.has_key?(:'map')
|
||||
if (value = attributes[:'map']).is_a?(Array)
|
||||
if (value = attributes[:'map']).is_a?(Hash)
|
||||
self.map = value
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user