Method: JSON::SchemaBuilder::Schema#_deep_merge

Defined in:
lib/json/schema_builder/schema.rb

#_deep_merge(this, other) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/json/schema_builder/schema.rb', line 40

def _deep_merge(this, other)
  this.deep_merge(other) do |current_key, this_value, other_value|
    if current_key == "anyOf"
      _deep_merge_any_of(Array(this_value), Array(other_value))
    elsif this_value.is_a?(::Array) && other_value.is_a?(::Array)
      this_value + other_value
    else
      other_value
    end
  end
end