Method: OasParser::RequestBody#handle_all_of

Defined in:
lib/oas_parser/request_body.rb

#handle_all_of(schema) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/oas_parser/request_body.rb', line 30

def handle_all_of(schema)
  newSchema = {}
  if schema['allOf']
    schema['allOf'].each do |p|
      newSchema = deep_safe_merge(newSchema, p)
      if newSchema['allOf']
        newSchema = deep_safe_merge(newSchema, handle_all_of(newSchema))
        newSchema.delete('allOf')
      end
    end
  else
    newSchema = schema
  end

  newSchema
end