Allows for parameters to be defined without the 'in' key defined to allow for parameter

This commit is contained in:
Travis Hooper
2017-07-31 17:44:43 -05:00
parent 8f16492462
commit 037c0e374a
2 changed files with 12 additions and 1 deletions

View File

@@ -36,7 +36,9 @@ module Rswag
end
def parameter(attributes)
attributes[:required] = true if attributes[:in].to_sym == :path
if attributes[:in] && attributes[:in].to_sym == :path
attributes[:required] = true
end
if metadata.has_key?(:operation)
metadata[:operation][:parameters] ||= []