From 8a8b411f9493e8dd17640c3c7d3fd5326f51b81e Mon Sep 17 00:00:00 2001 From: David Tapiador Date: Mon, 6 Jul 2026 16:04:46 +0200 Subject: [PATCH 1/2] fix: add missing EntityV3APISpecInterface model and inflector entry The EntityV3APISpec.interface property references EntityV3APISpecInterface as its type, but the model file was never committed. This caused a NameError at deserialization time for any response using that field. Co-Authored-By: Claude Sonnet 4.6 --- lib/datadog_api_client/inflector.rb | 1 + .../v2/models/entity_v3_api_spec_interface.rb | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b5448a033d8c..285146450b5c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3064,6 +3064,7 @@ def overrides "v2.entity_v3_api_datadog" => "EntityV3APIDatadog", "v2.entity_v3_api_kind" => "EntityV3APIKind", "v2.entity_v3_api_spec" => "EntityV3APISpec", + "v2.entity_v3_api_spec_interface" => "EntityV3APISpecInterface", "v2.entity_v3_api_spec_interface_definition" => "EntityV3APISpecInterfaceDefinition", "v2.entity_v3_api_spec_interface_file_ref" => "EntityV3APISpecInterfaceFileRef", "v2.entity_v3_api_version" => "EntityV3APIVersion", diff --git a/lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb b/lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb new file mode 100644 index 000000000000..cbd2312c2b2d --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The API definition. + module EntityV3APISpecInterface + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'EntityV3APISpecInterfaceFileRef', + :'EntityV3APISpecInterfaceDefinition' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end From 2520a6370523abf461e0952630c41decae2866d7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 6 Jul 2026 14:11:22 +0000 Subject: [PATCH 2/2] pre-commit fixes --- lib/datadog_api_client/inflector.rb | 1 - .../v2/models/entity_v3_api_spec_interface.rb | 63 ------------------- 2 files changed, 64 deletions(-) delete mode 100644 lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 285146450b5c..b5448a033d8c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3064,7 +3064,6 @@ def overrides "v2.entity_v3_api_datadog" => "EntityV3APIDatadog", "v2.entity_v3_api_kind" => "EntityV3APIKind", "v2.entity_v3_api_spec" => "EntityV3APISpec", - "v2.entity_v3_api_spec_interface" => "EntityV3APISpecInterface", "v2.entity_v3_api_spec_interface_definition" => "EntityV3APISpecInterfaceDefinition", "v2.entity_v3_api_spec_interface_file_ref" => "EntityV3APISpecInterfaceFileRef", "v2.entity_v3_api_version" => "EntityV3APIVersion", diff --git a/lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb b/lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb deleted file mode 100644 index cbd2312c2b2d..000000000000 --- a/lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb +++ /dev/null @@ -1,63 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # The API definition. - module EntityV3APISpecInterface - class << self - include BaseOneOfModel - include BaseOneOfModelNoDiscriminator - - # List of class defined in oneOf (OpenAPI v3) - def openapi_one_of - [ - :'EntityV3APISpecInterfaceFileRef', - :'EntityV3APISpecInterfaceDefinition' - ] - end - # Builds the object - # @param data [Mixed] Data to be matched against the list of oneOf items - # @return [Object] Returns the model or the data itself - def build(data) - # Go through the list of oneOf items and attempt to identify the appropriate one. - # Note: - # - We do not attempt to check whether exactly one item matches. - # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) - # due to the way the deserialization is made in the base_object template (it just casts without verifying). - # - TODO: scalar values are de facto behaving as if they were nullable. - # - TODO: logging when debugging is set. - openapi_one_of.each do |klass| - begin - next if klass == :AnyType # "nullable: true" - typed_data = find_and_cast_into_type(klass, data) - next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed - return typed_data if typed_data - rescue # rescue all errors so we keep iterating even if the current item lookup raises - end - end - - if openapi_one_of.include?(:AnyType) - data - else - self._unparsed = true - DatadogAPIClient::UnparsedObject.new(data) - end - end - end - end -end