Cleaning up the changes made by @vapir.
This commit is contained in:
1 parent
af61568cbe
commit
1e5f09a594
2 files changed
+69
-20
No files matched your search
@@ -47,8 +47,12 @@ module Google
|
||||
# and excess object creation, but this hopefully shouldn't be an
|
||||
# issue since it should only be called only once per schema per
|
||||
# process.
|
||||
if data.kind_of?(Hash) && data['$ref'].is_a?(String)
|
||||
reference = data['$ref']
|
||||
if data.kind_of?(Hash) && data['$ref']
|
||||
if data['$ref'].respond_to?(:to_str)
|
||||
reference = data['$ref'].to_str
|
||||
else
|
||||
raise TypeError, "Expected String, got #{data['$ref'].class}"
|
||||
end
|
||||
reference = '#' + reference if reference[0..0] != '#'
|
||||
data.merge({
|
||||
'$ref' => reference
|
||||
|
||||
Reference in new issue
Block a user