Class: Skooma::Objects::PathItem::Keywords::BaseOperation
- Inherits:
-
JSONSkooma::Keywords::Base
- Object
- JSONSkooma::Keywords::Base
- Skooma::Objects::PathItem::Keywords::BaseOperation
show all
- Defined in:
- lib/skooma/objects/path_item/keywords/base_operation.rb
Instance Method Summary
collapse
Instance Method Details
#evaluate(instance, result) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/skooma/objects/path_item/keywords/base_operation.rb', line 8
def evaluate(instance, result)
return result.discard unless instance["method"] == key
if json["responses"].nil? && instance["response"]
return result.failure("Responses are not listed for #{key.upcase} #{instance["path"]}")
end
json.evaluate(instance, result)
path_item_result = result.parent
path_item_result = path_item_result.parent until path_item_result.key.start_with?("/")
paths_result = path_item_result.parent
paths_result.annotate(paths_result.annotation.merge("method" => key))
return result.success if result.passed?
path = paths_result.annotation["current_path"]
result.failure("Path #{path}/#{key} is invalid")
end
|