openapi_first 0.16.1 → 0.17.0
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +3 -3
- data/benchmarks/Gemfile +1 -1
- data/benchmarks/Gemfile.lock +14 -15
- data/lib/openapi_first/request_validation.rb +2 -2
- data/lib/openapi_first/router.rb +5 -7
- data/lib/openapi_first/version.rb +1 -1
- data/openapi_first.gemspec +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6e1915ef20b0c31bd58a5f0bbba3d91b9be2915c9c0e1598e085d4bea142a06
|
4
|
+
data.tar.gz: 42c62a18aab203b1920adf1367cd9bc500c6e31b1e82fb8b4370ca34cedb372d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7985ff17cce925cb8ed24b47efaea39f4a2bef3a7f029de3edbef38a6ae555e57784d1346cfa0acbfd18b3d70124c4019dd0a5533990dccfcc408667b70b693
|
7
|
+
data.tar.gz: 8e28e55faf6de5246ff87c0943f507c2f93afe4d96f5bbde423feb15607295e7888d25c4add8054ec90103a4305161366f72c8088d0d8f64e053f9ba6902b592
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.17.0
|
4
|
+
|
5
|
+
- BREAKING CHANGE: Use a Hash instead of named arguments for middleware options for better compatibility
|
6
|
+
Using named arguments is actually not supported in Rack.
|
7
|
+
|
3
8
|
## 0.16.1
|
4
9
|
|
5
10
|
- Pin hanami-router version, because alpha6 is broken.
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openapi_first (0.
|
4
|
+
openapi_first (0.17.0)
|
5
5
|
deep_merge (>= 1.2.1)
|
6
6
|
hanami-router (= 2.0.alpha5)
|
7
7
|
hanami-utils (= 2.0.alpha3)
|
8
|
-
json_refs (>= 0.1.7)
|
8
|
+
json_refs (~> 0.1, >= 0.1.7)
|
9
9
|
json_schemer (~> 0.2.16)
|
10
10
|
multi_json (~> 1.14)
|
11
11
|
rack (~> 2.2)
|
@@ -70,7 +70,7 @@ GEM
|
|
70
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
71
71
|
rspec-support (~> 3.11.0)
|
72
72
|
rspec-support (3.11.0)
|
73
|
-
rubocop (1.
|
73
|
+
rubocop (1.27.0)
|
74
74
|
parallel (~> 1.10)
|
75
75
|
parser (>= 3.1.0.0)
|
76
76
|
rainbow (>= 2.2.2, < 4.0)
|
data/benchmarks/Gemfile
CHANGED
data/benchmarks/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
openapi_first (0.
|
4
|
+
openapi_first (0.17.0)
|
5
5
|
deep_merge (>= 1.2.1)
|
6
|
-
hanami-router (
|
7
|
-
hanami-utils (
|
8
|
-
json_refs (>= 0.1.7)
|
6
|
+
hanami-router (= 2.0.alpha5)
|
7
|
+
hanami-utils (= 2.0.alpha3)
|
8
|
+
json_refs (~> 0.1, >= 0.1.7)
|
9
9
|
json_schemer (~> 0.2.16)
|
10
10
|
multi_json (~> 1.14)
|
11
11
|
rack (~> 2.2)
|
@@ -13,12 +13,12 @@ PATH
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
15
15
|
specs:
|
16
|
-
activesupport (7.0.2.
|
16
|
+
activesupport (7.0.2.3)
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
18
|
i18n (>= 1.6, < 2)
|
19
19
|
minitest (>= 5.1)
|
20
20
|
tzinfo (~> 2.0)
|
21
|
-
benchmark-ips (2.
|
21
|
+
benchmark-ips (2.10.0)
|
22
22
|
benchmark-memory (0.2.0)
|
23
23
|
memory_profiler (~> 1)
|
24
24
|
builder (3.2.4)
|
@@ -26,7 +26,7 @@ GEM
|
|
26
26
|
json_schema (~> 0.14, >= 0.14.3)
|
27
27
|
openapi_parser (>= 0.11.1, < 1.0)
|
28
28
|
rack (>= 1.5)
|
29
|
-
concurrent-ruby (1.1.
|
29
|
+
concurrent-ruby (1.1.10)
|
30
30
|
deep_merge (1.2.2)
|
31
31
|
dry-configurable (0.14.0)
|
32
32
|
concurrent-ruby (~> 1.0)
|
@@ -63,11 +63,11 @@ GEM
|
|
63
63
|
mustermann (~> 1.0)
|
64
64
|
mustermann-contrib (~> 1.0)
|
65
65
|
rack (~> 2.0)
|
66
|
-
hanami-utils (2.0.0.
|
66
|
+
hanami-utils (2.0.0.alpha3)
|
67
67
|
concurrent-ruby (~> 1.0)
|
68
68
|
dry-transformer (~> 0.1)
|
69
69
|
hansi (0.2.0)
|
70
|
-
i18n (1.
|
70
|
+
i18n (1.10.0)
|
71
71
|
concurrent-ruby (~> 1.0)
|
72
72
|
json_refs (0.1.7)
|
73
73
|
hana
|
@@ -91,17 +91,17 @@ GEM
|
|
91
91
|
rack (2.2.3)
|
92
92
|
rack-accept (0.4.5)
|
93
93
|
rack (>= 0.4)
|
94
|
-
rack-protection (2.
|
94
|
+
rack-protection (2.2.0)
|
95
95
|
rack
|
96
96
|
regexp_parser (2.2.1)
|
97
97
|
roda (3.54.0)
|
98
98
|
rack
|
99
99
|
ruby2_keywords (0.0.5)
|
100
100
|
seg (1.2.0)
|
101
|
-
sinatra (2.
|
101
|
+
sinatra (2.2.0)
|
102
102
|
mustermann (~> 1.0)
|
103
103
|
rack (~> 2.2)
|
104
|
-
rack-protection (= 2.
|
104
|
+
rack-protection (= 2.2.0)
|
105
105
|
tilt (~> 2.0)
|
106
106
|
syro (3.2.1)
|
107
107
|
rack (>= 1.6.0)
|
@@ -113,7 +113,6 @@ GEM
|
|
113
113
|
|
114
114
|
PLATFORMS
|
115
115
|
arm64-darwin-21
|
116
|
-
x86_64-darwin-20
|
117
116
|
|
118
117
|
DEPENDENCIES
|
119
118
|
benchmark-ips
|
@@ -121,7 +120,7 @@ DEPENDENCIES
|
|
121
120
|
committee
|
122
121
|
grape
|
123
122
|
hanami-api
|
124
|
-
hanami-router
|
123
|
+
hanami-router
|
125
124
|
multi_json
|
126
125
|
openapi_first!
|
127
126
|
roda
|
@@ -129,4 +128,4 @@ DEPENDENCIES
|
|
129
128
|
syro
|
130
129
|
|
131
130
|
BUNDLED WITH
|
132
|
-
2.
|
131
|
+
2.3.10
|
@@ -10,9 +10,9 @@ module OpenapiFirst
|
|
10
10
|
class RequestValidation # rubocop:disable Metrics/ClassLength
|
11
11
|
prepend RouterRequired
|
12
12
|
|
13
|
-
def initialize(app,
|
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
|
data/lib/openapi_first/router.rb
CHANGED
@@ -7,15 +7,13 @@ module OpenapiFirst
|
|
7
7
|
class Router
|
8
8
|
def initialize(
|
9
9
|
app,
|
10
|
-
|
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
|
data/openapi_first.gemspec
CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_runtime_dependency 'deep_merge', '>= 1.2.1'
|
38
38
|
spec.add_runtime_dependency 'hanami-router', '2.0.alpha5'
|
39
39
|
spec.add_runtime_dependency 'hanami-utils', '2.0.alpha3'
|
40
|
-
spec.add_runtime_dependency 'json_refs', '>= 0.1.7'
|
40
|
+
spec.add_runtime_dependency 'json_refs', '~> 0.1', '>= 0.1.7'
|
41
41
|
spec.add_runtime_dependency 'json_schemer', '~> 0.2.16'
|
42
42
|
spec.add_runtime_dependency 'multi_json', '~> 1.14'
|
43
43
|
spec.add_runtime_dependency 'rack', '~> 2.2'
|
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.
|
4
|
+
version: 0.17.0
|
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-04-
|
11
|
+
date: 2022-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deep_merge
|
@@ -56,6 +56,9 @@ dependencies:
|
|
56
56
|
name: json_refs
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.1'
|
59
62
|
- - ">="
|
60
63
|
- !ruby/object:Gem::Version
|
61
64
|
version: 0.1.7
|
@@ -63,6 +66,9 @@ dependencies:
|
|
63
66
|
prerelease: false
|
64
67
|
version_requirements: !ruby/object:Gem::Requirement
|
65
68
|
requirements:
|
69
|
+
- - "~>"
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0.1'
|
66
72
|
- - ">="
|
67
73
|
- !ruby/object:Gem::Version
|
68
74
|
version: 0.1.7
|