lib/dry/schema/extensions/info/schema_compiler.rb in dry-schema-1.8.0 vs lib/dry/schema/extensions/info/schema_compiler.rb in dry-schema-1.9.0
- old
+ new
@@ -94,10 +94,19 @@
if name.equal?(:key?)
keys[rest[0][1]] = {required: opts.fetch(:required, true)}
else
type = PREDICATE_TO_TYPE[name]
- keys[key][:type] = type if type
+ assign_type(key, type) if type
+ end
+ end
+
+ # @api private
+ def assign_type(key, type)
+ if keys[key][:type]
+ keys[key][:member] = type
+ else
+ keys[key][:type] = type
end
end
end
end
end