Allow tests to be run without generating docs

By providing the 'document: false' metadata, tests will be run but no swagger
documentation will be generated for the tagged example groups. It works on all
kinds of example groups (responses, verbs, paths etc..).
This commit is contained in:
Karl Johansson
2019-11-15 15:59:18 +01:00
parent 02a5bc988f
commit 4c613af2ba
3 changed files with 52 additions and 16 deletions

View File

@@ -25,7 +25,11 @@ module Rswag
metadata = notification.metadata
end
# !metadata[:document] won't work, since nil means we should generate
# docs.
return if metadata[:document] == false
return unless metadata.has_key?(:response)
swagger_doc = @config.get_swagger_doc(metadata[:swagger_doc])
swagger_doc.deep_merge!(metadata_to_swagger(metadata))
end