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:
parent
bd1ce540d4
commit
b6ef9b00ad
|
@ -47,7 +47,7 @@ module Google
|
||||||
# and excess object creation, but this hopefully shouldn't be an
|
# and excess object creation, but this hopefully shouldn't be an
|
||||||
# issue since it should only be called only once per schema per
|
# issue since it should only be called only once per schema per
|
||||||
# process.
|
# process.
|
||||||
if data.kind_of?(Hash) && data['$ref']
|
if data.kind_of?(Hash) && data['$ref'].is_a?(String)
|
||||||
reference = data['$ref']
|
reference = data['$ref']
|
||||||
reference = '#' + reference if reference[0..0] != '#'
|
reference = '#' + reference if reference[0..0] != '#'
|
||||||
data.merge({
|
data.merge({
|
||||||
|
|
Loading…
Reference in New Issue