openapi-ruby 2.5.0 → 2.5.1

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: e5b5aa8b42fe199142eb84aa503b7ed590e2cb0399790a3a749f1df5a98c543b
4
+ data.tar.gz: 9a32a812806610a71af36ea018ca7774dbc8cfd8f0ea3d44a73b91303e3dbec2
5
5
  SHA512:
6
- metadata.gz: d86968a1f1cdb51da0018e7679174f4fa7b527d5486c11f0bbbfbf7f01484054aafe1cc61021db1af0eb9fad5009281cb6e0d23684d7beb4d9b5b11201311467
7
- data.tar.gz: 1321040fcdbad45bcca7e7ae2f908252ef998aca9cdd78535a72e7a15e5c2abbd334818e49f3b7663301b7f96c995904acb98d17fcffdfcafc8362bfbfcb968f
6
+ metadata.gz: 78d10fcbf342b18f50988bf9984767cc911fc8e3466a6f07cc5b6f404277b5fa7cb93bbc41767e1eb185fd46c04503e0fb714c02ebbfa5bc78ae1f1a5393bff3
7
+ data.tar.gz: 6c520011e5868a4c1dca5d6b2bd51ef066cc40c9006cd8411962b250364d4aabcc7ae201982324088611eb4e35055800c90500949ca5dbe4e58df0fcde300333
@@ -77,7 +77,13 @@ 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
+ # Don't overwrite a visible response with a hidden one — hidden responses
83
+ # are test-only variants that should not remove the endpoint from the schema.
84
+ existing = @responses[key]
85
+ @responses[key] = ctx unless hidden && existing && !existing.hidden
86
+
81
87
  ctx
82
88
  end
83
89
 
@@ -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.1"
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morten Hartvig