lib/swagger/dsl/parameters.rb in swagger-dsl-1.3.0 vs lib/swagger/dsl/parameters.rb in swagger-dsl-1.4.0

- old
+ new

@@ -8,10 +8,14 @@ instance_eval(&block) end %i[path query header cookie].each do |in_type| define_method(in_type) do |*args, &block| - args.empty? ? ParametersInType.new(self, in_type, { default_required: @default_required }, &block) : self << Parameter.new({ default_required: @default_required }, *args, in: in_type, &block) + if args.empty? + ParametersInType.new(self, in_type, { default_required: @default_required }, &block) + else + self << Parameter.new({ default_required: @default_required }, *args, in: in_type, &block) + end end end end end end