diff --git a/lib/datadog_api_client/v1/model_base.rb b/lib/datadog_api_client/v1/model_base.rb index 203568f08509..d56c5b331d47 100644 --- a/lib/datadog_api_client/v1/model_base.rb +++ b/lib/datadog_api_client/v1/model_base.rb @@ -83,6 +83,11 @@ def build_from_hash(attributes) end if self.respond_to?(:additional_properties) + self.class.openapi_types.each_key do |key| + json_key = self.class.attribute_map[key] + next unless json_key && attributes.key?(json_key) + self.additional_properties[json_key] = self.send(key) + end attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) self.additional_properties[k.to_sym] = v diff --git a/lib/datadog_api_client/v2/model_base.rb b/lib/datadog_api_client/v2/model_base.rb index 7bdfde0c6bcd..357c5187628e 100644 --- a/lib/datadog_api_client/v2/model_base.rb +++ b/lib/datadog_api_client/v2/model_base.rb @@ -83,6 +83,11 @@ def build_from_hash(attributes) end if self.respond_to?(:additional_properties) + self.class.openapi_types.each_key do |key| + json_key = self.class.attribute_map[key] + next unless json_key && attributes.key?(json_key) + self.additional_properties[json_key] = self.send(key) + end attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) self.additional_properties[k.to_sym] = v