openapi-ruby 2.5.2 → 2.6.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: d848804ceb3fc5fc4a35b4e32ed38250520e94536001d7798a2f23b03dc6781f
4
- data.tar.gz: 2303f5596b77a8df989fd1179634a871488f9dced8c44b95034495c5656cf087
3
+ metadata.gz: 184a7fbab1cd65b421542bd525d0caece4c5ca9f86fba8902a73566935a34b56
4
+ data.tar.gz: 1999bdb9cfa6cb89804a45bc8ace6d820a55e4cc14d01fd9b7b12f8094d05098
5
5
  SHA512:
6
- metadata.gz: 4ba58fc6958c579f35ae6d3924410f2f7fcf7547aea1e1eba647d1dec6c5c18114f23312351b52f59481f7dd40ebe67d60b54ffdc5d64294bd27aea3e5f24f1a
7
- data.tar.gz: dbdec3d9481be42c64355af209e75f4ccbed7f4e75b7805c11b9e6feadd3023b1c3de39bffe0bd500192f54bdb051a52010442a0893828dd1984252a3a869d02
6
+ metadata.gz: c3338c403c393bb1ae5ef93e15b8045f0e80ff9c3f797343089cff850a6218eb59c2eebc93f99a839d6d355cea25f29dd87f49281a04623a1c8e87a243c4124c
7
+ data.tar.gz: f191b3fdf19fe89e7041734d017854ed94d2197d03ce932742fb9d03db42b2bce6f512bdc1dd5cc8ddd2fd76f85c99c5cb0b89d9446b837ce8d070965be7b2b4
@@ -161,7 +161,8 @@ module OpenapiRuby
161
161
  schema_config.dig("components", "securitySchemes") || {}
162
162
 
163
163
  if security_schemes.empty?
164
- loader = Components::Loader.new(scope: schema_name.to_s.tr("/", "_").to_sym)
164
+ scope = schema_config[:component_scope] || schema_config["component_scope"]
165
+ loader = Components::Loader.new(scope: scope&.to_sym)
165
166
  security_schemes = loader.security_schemes
166
167
  end
167
168
 
@@ -232,9 +232,10 @@ module OpenapiRuby
232
232
  security_schemes = schema_config.dig(:components, :securitySchemes) ||
233
233
  schema_config.dig("components", "securitySchemes") || {}
234
234
 
235
- # Also check registered components
235
+ # Also check registered components using the schema's configured scope
236
236
  if security_schemes.empty?
237
- loader = Components::Loader.new(scope: schema_name.to_s.tr("/", "_").to_sym)
237
+ scope = schema_config[:component_scope] || schema_config["component_scope"]
238
+ loader = Components::Loader.new(scope: scope&.to_sym)
238
239
  security_schemes = loader.security_schemes
239
240
  end
240
241
 
@@ -3,7 +3,7 @@
3
3
  module OpenapiRuby
4
4
  module Core
5
5
  class Document
6
- MIN_OPENAPI_VERSION = "3.1.0"
6
+ MIN_OPENAPI_VERSION = "3.0.0"
7
7
  DEFAULT_OPENAPI_VERSION = "3.1.0"
8
8
 
9
9
  attr_reader :data
@@ -28,7 +28,7 @@ module OpenapiRuby
28
28
  end
29
29
 
30
30
  def set_security(security)
31
- @data["security"] = security if security.any?
31
+ @data["security"] = security
32
32
  end
33
33
 
34
34
  def set_tags(tags)
@@ -34,8 +34,8 @@ module OpenapiRuby
34
34
  def to_openapi
35
35
  result = {}
36
36
 
37
- result["parameters"] = @path_parameters if @path_parameters.any?
38
-
37
+ # Path-level parameters are already copied into each operation (line 27),
38
+ # so we don't output them at the path level to avoid duplicates.
39
39
  @operations.each do |verb, op|
40
40
  result[verb] = op.to_openapi
41
41
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenapiRuby
4
- VERSION = "2.5.2"
4
+ VERSION = "2.6.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.2
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morten Hartvig