Skip to content

Commit 68926f0

Browse files
Revert unrelated change.
1 parent 70c461b commit 68926f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/datadog_api_client/v2/model_base.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _deserialize(type, value)
124124
# generic array, return directly
125125
value
126126
when :UUID
127-
value.to_s
127+
value
128128
when /\AArray<(?<inner_type>.+)>\z/
129129
inner_type = Regexp.last_match[:inner_type]
130130
value.map { |v| _deserialize(inner_type, v) }
@@ -255,7 +255,9 @@ def find_and_cast_into_type(klass, data)
255255
when 'Object' # "type: object"
256256
return data if data.instance_of?(Hash)
257257
when 'UUID'
258-
return UUIDTools::UUID.parse(data)
258+
raise TypeError, "Expected String, got #{uuid_string.class.name} instead." unless uuid_string.kind_of?(String)
259+
raise ArgumentError, "Invalid UUID format." unless /\A\h{8}-\h{4}-\h{4}-\h{4}-\h{12}\z/.match?(data)
260+
return data
259261
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
260262
if data.instance_of?(Array)
261263
sub_type = Regexp.last_match[:sub_type]

0 commit comments

Comments
 (0)