More carefully resolving the discovery-of-discovery issue.

This commit is contained in:
Bob Aman 2012-02-27 12:23:33 +01:00
parent 1e5f09a594
commit 2b9ac92b7e
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,8 @@ 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']
if data.kind_of?(Hash) &&
data['$ref'] && !data['$ref'].kind_of?(Hash)
if data['$ref'].respond_to?(:to_str)
reference = data['$ref'].to_str
else