From 659b328eda7d07b5a54009e16815ee1e3fae127f Mon Sep 17 00:00:00 2001 From: Jay Danielian Date: Wed, 17 Jul 2019 20:35:56 -0400 Subject: [PATCH] Fixes spec for #stop writing swagger docs --- rswag-specs/lib/rswag/specs/swagger_formatter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rswag-specs/lib/rswag/specs/swagger_formatter.rb b/rswag-specs/lib/rswag/specs/swagger_formatter.rb index 3456e40..d0d447f 100644 --- a/rswag-specs/lib/rswag/specs/swagger_formatter.rb +++ b/rswag-specs/lib/rswag/specs/swagger_formatter.rb @@ -35,7 +35,7 @@ module Rswag def stop(_notification = nil) @config.swagger_docs.each do |url_path, doc| # remove 2.0 parameters - doc[:paths].each_pair do |_k, v| + doc[:paths]&.each_pair do |_k, v| v.each_pair do |_verb, value| is_hash = value.is_a?(Hash) if is_hash && value.dig(:parameters)