openapi-ruby 2.5.0 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b425b7d5cf7a5dc4768214f1aa26d5d8786cf3ceb6cf113ce05cf52412be7249
4
- data.tar.gz: 7ff62541a6000e03418958afa9255b58ea7b254449a2b1ff9a159dd06c9696ff
3
+ metadata.gz: d848804ceb3fc5fc4a35b4e32ed38250520e94536001d7798a2f23b03dc6781f
4
+ data.tar.gz: 2303f5596b77a8df989fd1179634a871488f9dced8c44b95034495c5656cf087
5
5
  SHA512:
6
- metadata.gz: d86968a1f1cdb51da0018e7679174f4fa7b527d5486c11f0bbbfbf7f01484054aafe1cc61021db1af0eb9fad5009281cb6e0d23684d7beb4d9b5b11201311467
7
- data.tar.gz: 1321040fcdbad45bcca7e7ae2f908252ef998aca9cdd78535a72e7a15e5c2abbd334818e49f3b7663301b7f96c995904acb98d17fcffdfcafc8362bfbfcb968f
6
+ metadata.gz: 4ba58fc6958c579f35ae6d3924410f2f7fcf7547aea1e1eba647d1dec6c5c18114f23312351b52f59481f7dd40ebe67d60b54ffdc5d64294bd27aea3e5f24f1a
7
+ data.tar.gz: dbdec3d9481be42c64355af209e75f4ccbed7f4e75b7805c11b9e6feadd3023b1c3de39bffe0bd500192f54bdb051a52010442a0893828dd1984252a3a869d02
@@ -77,7 +77,14 @@ module OpenapiRuby
77
77
  ctx = ResponseContext.new(status_code, description, hidden: hidden)
78
78
  ctx.produces(*@produces_list) if @produces_list.any?
79
79
  ctx.instance_eval(&block) if block
80
- @responses[status_code.to_s] = ctx
80
+
81
+ key = status_code.to_s
82
+ # Keep the first visible response for each status code. Subsequent responses
83
+ # with the same code are test variants and should not overwrite the schema.
84
+ # A visible response always wins over a hidden one.
85
+ existing = @responses[key]
86
+ @responses[key] = ctx if existing.nil? || (existing.hidden && !hidden)
87
+
81
88
  ctx
82
89
  end
83
90
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenapiRuby
4
- VERSION = "2.5.0"
4
+ VERSION = "2.5.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openapi-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morten Hartvig