More carefully resolving the discovery-of-discovery issue.
authorBob Aman <bobaman@google.com>
Mon, 27 Feb 2012 11:23:33 +0000 (12:23 +0100)
committerBob Aman <bobaman@google.com>
Mon, 27 Feb 2012 11:23:33 +0000 (12:23 +0100)
lib/google/api_client/discovery/schema.rb

index f8a34b6b04dd9bb9d3e9076beb7ae96548bf3aac..eebf7dddbdee1feca5f4992e9acf7b093d8e35c4 100644 (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