Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ group :development, :test do
gem 'webmock'
gem 'zstandard'
gem 'pry'
gem 'uuidtools'
end

group :docs do
Expand Down
1 change: 0 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ tomlrb,MIT,Francois Bernier
typhoeus,MIT,"David Balatero, Paul Dix, Hans Hasselberg"
tzinfo,MIT,Philip Ross
unicode-display_width,MIT,Jan Lelis
uuidtools,Apache-2.0,Bob Aman
vcr,"Hippocratic-2.1,MIT","Myron Marston, Kurtis Rainbolt-Greene, Olle Jonsson"
webmock,MIT,Bartosz Blimke
with_env,MIT,Zach Dennis
Expand Down
2 changes: 0 additions & 2 deletions datadog_api_client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Gem::Specification.new do |spec|

spec.add_runtime_dependency "zeitwerk", "~> 2.6", ">= 2.6.0"

spec.add_runtime_dependency "uuidtools", "~> 2.1.5", ">= 2.1.5"

spec.add_development_dependency "rspec", "~> 3.6", ">= 3.6.0"

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|cassettes)/}) }
Expand Down
6 changes: 4 additions & 2 deletions lib/datadog_api_client/v2/model_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _deserialize(type, value)
# generic array, return directly
value
when :UUID
value.to_s
value
when /\AArray<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
Expand Down Expand Up @@ -255,7 +255,9 @@ def find_and_cast_into_type(klass, data)
when 'Object' # "type: object"
return data if data.instance_of?(Hash)
when 'UUID'
return UUIDTools::UUID.parse(data)
raise TypeError, "Expected String, got #{uuid_string.class.name} instead." unless uuid_string.kind_of?(String)
raise ArgumentError, "Invalid UUID format." unless /\A\h{8}-\h{4}-\h{4}-\h{4}-\h{12}\z/.match?(data)
return data
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
if data.instance_of?(Array)
sub_type = Regexp.last_match[:sub_type]
Expand Down
Loading