Skip to content

Commit 979d2fd

Browse files
committed
Merge pull request #70 from gwshaw/69_allow_vendor_specific_tags
Issue# 69 Allow vendor specific tags at the verb level
2 parents 9f2d1e5 + aa91013 commit 979d2fd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/apivore/swagger.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ def each_response(&block)
2929
next if vendor_specific_tag? path
3030
path_data.each do |verb, method_data|
3131
next if NONVERB_PATH_ITEMS.include?(verb)
32-
raise "No responses found in swagger for path '#{path}', method #{verb}: #{method_data.inspect}" if method_data.responses.nil?
32+
next if vendor_specific_tag? verb
33+
if method_data.responses.nil?
34+
raise "No responses found in swagger for path '#{path}', " \
35+
"method #{verb}: #{method_data.inspect}"
36+
end
3337
method_data.responses.each do |response_code, response_data|
3438
schema_location = nil
3539
if response_data.schema

spec/data/01_sample2.0.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"paths": {
1919
"x-something": "Vendor Specific Tag",
2020
"/services.json": {
21+
"x-something": "Vendor Specific Tag",
2122
"get": {
2223
"description": "Services available to shoppers.",
2324
"operationId": "Services#index",

0 commit comments

Comments
 (0)