openapi_first 0.15.0 → 0.16.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c24075e5a05299387bba14bb16f931cf5e0f6cad58f0b0af04603ceb568dd78
4
- data.tar.gz: 6e3eba2165048d139af385e736320157d6332f307d1cf99afe25172d5d48910d
3
+ metadata.gz: 5f46ad8751619914fa7b387ecb8a0178e67a7ba070e863321463f7ae1097e250
4
+ data.tar.gz: 5961b6bff590f957a8908d62b3c87bd65438dbdfe055020c61739af2862b06cc
5
5
  SHA512:
6
- metadata.gz: 65b51042f045570f3f357108aee08519be8e0f0b0ca2b997fa4ba3bbb49bd4febb98a28efb624f6cacd41074383c7b8920748c2997fe5d943108d3d72db5194e
7
- data.tar.gz: 9188f1624b57d2eb5eea004bef5b086037681603a7dc788b1810faa42b44005360663326d81aa53ba549442c8667fef6b4830dfc542f7f39e77c011db25f01f2
6
+ metadata.gz: 0e08b5d1b12f3379ef2f28ab98da925a43c7adc69ea617c305dedb06fbe63e7843cf0d861cd32d7942f7770b4f7ac9bb2762ffb179374fd15deff2b86f64899f
7
+ data.tar.gz: ac406a2a868a44b8cfb8d54a71b5c4fb1d1078f666c6f3ee683a191c83c090a8312f59bd399e089edb4062d309ca98df02ee8b2078a445c1e3b16e5e19cfd462
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ - Use a Hash instead of named arguments for middleware options for better compatibility
6
+
3
7
  ## 0.15.0
4
8
 
5
9
  - Populate default parameter values
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openapi_first (0.15.0)
4
+ openapi_first (0.16.0.beta1)
5
5
  deep_merge (>= 1.2.1)
6
6
  hanami-router (~> 2.0.alpha5)
7
7
  hanami-utils (~> 2.0.alpha3)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- openapi_first (0.15.0)
4
+ openapi_first (0.16.0.beta1)
5
5
  deep_merge (>= 1.2.1)
6
6
  hanami-router (~> 2.0.alpha5)
7
7
  hanami-utils (~> 2.0.alpha3)
@@ -10,9 +10,9 @@ module OpenapiFirst
10
10
  class RequestValidation # rubocop:disable Metrics/ClassLength
11
11
  prepend RouterRequired
12
12
 
13
- def initialize(app, raise_error: false)
13
+ def initialize(app, options = {})
14
14
  @app = app
15
- @raise = raise_error
15
+ @raise = options.fetch(:raise_error, false)
16
16
  end
17
17
 
18
18
  def call(env) # rubocop:disable Metrics/AbcSize
@@ -7,15 +7,13 @@ module OpenapiFirst
7
7
  class Router
8
8
  def initialize(
9
9
  app,
10
- spec:,
11
- raise_error: false,
12
- not_found: :halt,
13
- parent_app: nil
10
+ options
14
11
  )
15
12
  @app = app
16
- @parent_app = parent_app
17
- @raise = raise_error
18
- @not_found = not_found
13
+ @parent_app = options.fetch(:parent_app, nil)
14
+ @raise = options.fetch(:raise_error, false)
15
+ @not_found = options.fetch(:not_found, :halt)
16
+ spec = options.fetch(:spec)
19
17
  @filepath = spec.filepath
20
18
  @router = build_router(spec.operations)
21
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenapiFirst
4
- VERSION = '0.15.0'
4
+ VERSION = '0.16.0.beta1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openapi_first
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Haller
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-14 00:00:00.000000000 Z
11
+ date: 2022-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge
@@ -239,9 +239,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
239
  version: 2.6.0
240
240
  required_rubygems_version: !ruby/object:Gem::Requirement
241
241
  requirements:
242
- - - ">="
242
+ - - ">"
243
243
  - !ruby/object:Gem::Version
244
- version: '0'
244
+ version: 1.3.1
245
245
  requirements: []
246
246
  rubygems_version: 3.3.3
247
247
  signing_key: