mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 10:32:42 +00:00
[ruby] fix oneOf handling (#5706)
* [ruby] fix oneOf handling * use previous ruby configs due to issue #4690 * check for oneOf model in base_object * validate the attributes in partial_oneof_module
This commit is contained in:
@@ -274,8 +274,9 @@ module DynamicServers
|
||||
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
||||
end
|
||||
else
|
||||
# models, e.g. Pet
|
||||
DynamicServers.const_get(return_type).build_from_hash(data)
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = DynamicServers.const_get(return_type)
|
||||
klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user