7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/meta/utils/route_dsl_builders.rb', line 7
def merge_meta_options(options1, options2)
final_options = (options1 || {}).merge(options2 || {})
if options1[:parameters] && options2[:parameters]
final_options[:parameters] = options1[:parameters].merge(options2[:parameters])
end
if options1[:request_body].is_a?(Meta::JsonSchema::ObjectSchema) && options2[:request_body].is_a?(Meta::JsonSchema::ObjectSchema)
final_options[:request_body] = options1[:request_body].properties.merge(options2[:request_body].properties)
end
if options1[:responses] && options2[:responses]
final_options[:responses] = options1[:responses].merge(options2[:responses])
end
final_options[:scope] = [options1[:scope] || [], options2[:scope] || []].flatten.uniq
final_options
end
|