lib/algolia/models/search/ignore_plurals.rb in algolia-3.2.2 vs lib/algolia/models/search/ignore_plurals.rb in algolia-3.2.3
- old
+ new
@@ -10,11 +10,12 @@
class << self
# List of class defined in oneOf (OpenAPI v3)
def openapi_one_of
[
:"Array<SupportedLanguage>",
- :"Boolean"
+ :"Boolean",
+ :"BooleanString"
]
end
# Builds the object
# @param [Mixed] Data to be matched against the list of oneOf items
@@ -79,15 +80,18 @@
end
# model
else
const = Algolia::Search.const_get(klass)
if const
- # nested oneOf model
if const.respond_to?(:openapi_one_of)
+ # nested oneOf model
model = const.build(data)
- else
+ elsif const.respond_to?(:acceptable_attributes)
# raise if data contains keys that are not known to the model
raise unless (data.keys - const.acceptable_attributes).empty?
+ model = const.build_from_hash(data)
+ else
+ # maybe it's an enum
model = const.build_from_hash(data)
end
return model if model
end