Skip to content

Commit cd4d2ca

Browse files
author
ci.datadog-api-spec
committed
pre-commit fixes
1 parent 3b86f52 commit cd4d2ca

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/datadog_api_client/v2/model_base.rb

Lines changed: 2 additions & 4 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
127+
value.to_s
128128
when /\AArray<(?<inner_type>.+)>\z/
129129
inner_type = Regexp.last_match[:inner_type]
130130
value.map { |v| _deserialize(inner_type, v) }
@@ -255,9 +255,7 @@ 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-
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
258+
return UUIDTools::UUID.parse(data)
261259
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
262260
if data.instance_of?(Array)
263261
sub_type = Regexp.last_match[:sub_type]

0 commit comments

Comments
 (0)