From 7f0e437f8bb414797d1eaf744f2f77d1476a49c1 Mon Sep 17 00:00:00 2001 From: domaindrivendev Date: Fri, 21 Jul 2017 21:04:46 -0700 Subject: [PATCH] For rswag, param names MUST be unique --- rswag-specs/lib/rswag/specs/request_factory.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rswag-specs/lib/rswag/specs/request_factory.rb b/rswag-specs/lib/rswag/specs/request_factory.rb index 20e499f..81aeb54 100644 --- a/rswag-specs/lib/rswag/specs/request_factory.rb +++ b/rswag-specs/lib/rswag/specs/request_factory.rb @@ -33,7 +33,7 @@ module Rswag .concat(path_item_params) .concat(security_params) .map { |p| p['$ref'] ? resolve_parameter(p['$ref'], swagger_doc) : p } - .uniq { |p| "#{p[:name]}_#{p[:in]}" } + .uniq { |p| p[:name] } .reject { |p| p[:required] == false && !example.respond_to?(p[:name]) } end @@ -139,7 +139,7 @@ module Rswag end def build_form_payload(parameters, example) - #See http://seejohncode.com/2012/04/29/quick-tip-testing-multipart-uploads-with-rspec/ + # See http://seejohncode.com/2012/04/29/quick-tip-testing-multipart-uploads-with-rspec/ # Rather that serializing with the appropriate encoding (e.g. multipart/form-data), # Rails test infrastructure allows us to send the values directly as a hash # PROS: simple to implement, CONS: serialization/deserialization is bypassed in test