Module: OpenapiContracts

Includes:
ActiveSupport::Configurable
Defined in:
lib/openapi_contracts.rb,
lib/openapi_contracts/doc.rb,
lib/openapi_contracts/match.rb,
lib/openapi_contracts/helper.rb,
lib/openapi_contracts/parser.rb,
lib/openapi_contracts/coverage.rb,
lib/openapi_contracts/doc/path.rb,
lib/openapi_contracts/doc/header.rb,
lib/openapi_contracts/doc/schema.rb,
lib/openapi_contracts/validators.rb,
lib/openapi_contracts/doc/pointer.rb,
lib/openapi_contracts/doc/request.rb,
lib/openapi_contracts/doc/response.rb,
lib/openapi_contracts/doc/operation.rb,
lib/openapi_contracts/doc/parameter.rb,
lib/openapi_contracts/payload_parser.rb,
lib/openapi_contracts/operation_router.rb,
lib/openapi_contracts/doc/with_parameters.rb

Defined Under Namespace

Modules: Helper, Validators Classes: Coverage, Doc, Env, Match, OperationRouter, Parser, PayloadParser

Class Method Summary collapse

Class Method Details

.hash_bury(hash, keys, value) ⇒ Object



36
37
38
39
# File 'lib/openapi_contracts.rb', line 36

def hash_bury(hash, keys, value)
  other = keys.reverse.reduce(value) { |m, k| {k => m} }
  hash.deep_merge other
end

.hash_bury!(hash, keys, value) ⇒ Object



41
42
43
44
45
# File 'lib/openapi_contracts.rb', line 41

def hash_bury!(hash, keys, value)
  other = keys.reverse.reduce(value) { |m, k| {k => m} }
  hash.deep_merge! other
  other
end

.match(doc, response, options = {}) ⇒ Object



32
33
34
# File 'lib/openapi_contracts.rb', line 32

def match(doc, response, options = {})
  Match.new(doc, response, options)
end