fix schema to not choke when '$ref' is specifying what the '$ref' property actually is, rather than invoking it, and is therefore not a string.

this applies to the schema JsonSchema, specified in the document for the discovery service itself
This commit is contained in:
Ethan 2012-01-08 01:38:48 -05:00
parent bd1ce540d4
commit b6ef9b00ad
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ 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'].is_a?(String)
reference = data['$ref']
reference = '#' + reference if reference[0..0] != '#'
data.merge({