Skip to content

Commit e03028f

Browse files
author
Jeff Cousens
committed
if schema.key?('key') -> if schema['key']
1 parent 24cb46d commit e03028f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/swagger/diff/specification.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ def add_property(ret, prefix, name, schema, required, list)
187187

188188
def properties_for_ref(prefix, name, schema, required, list = false)
189189
ret = { required: Set.new, all: Set.new }
190-
if schema.key?('$ref')
190+
if schema['$ref']
191191
merge_refs!(ret, nested(schema['$ref'], prefix, name, list))
192-
elsif schema.key?('properties')
192+
elsif schema['properties']
193193
prefix = "#{name}#{'[]' if list}/"
194194
merge_refs!(ret, properties(schema['properties'], schema['required'], prefix))
195195
else
@@ -225,7 +225,7 @@ def properties(properties, required, prefix = '')
225225
properties.each do |name, schema|
226226
if schema['type'] == 'array'
227227
merge_refs!(ret, properties_for_ref(prefix, name, schema['items'], required, true))
228-
elsif schema['type'] == 'object' || schema.key?('properties')
228+
elsif schema['type'] == 'object' || schema['properties']
229229
if schema['allOf']
230230
# TODO: handle nested allOfs.
231231
elsif schema['properties']

0 commit comments

Comments
 (0)