openapi_first 0.16.0.beta1 → 0.16.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 +2 -2
- data/Gemfile.lock +4 -3
- data/benchmarks/Gemfile.lock +1 -1
- data/lib/openapi_first/operation.rb +1 -0
- data/lib/openapi_first/request_validation.rb +2 -2
- data/lib/openapi_first/router.rb +7 -5
- data/lib/openapi_first/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ac3d5709b36ac797521a16ec11af5fe1106faf2aa2a48daf502516cc875fad47
|
|
4
|
+
data.tar.gz: 311e4b513cb5e655397e38cadfec1eff07ae70d1136c75197f87dba8b058073c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 85d40c11308a34a3f1a7c9886cf9826d5a36b6e9d8dc15f0a6bf9ae0d435b88f9e16576b339b0dc3b4e2a3c13bc00710fdbe6dd6bdabf1d8aa644f7f34f6cfd7
|
|
7
|
+
data.tar.gz: ce475547d199cfabd050e4bdcbf995cecd9a72480b9bfe32e8b84e3287b4be5a95970063542522437362dd65154719c40bb3bc8449b5e4ec82a30c9bfec3f337
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
openapi_first (0.16.0
|
|
4
|
+
openapi_first (0.16.0)
|
|
5
5
|
deep_merge (>= 1.2.1)
|
|
6
6
|
hanami-router (~> 2.0.alpha5)
|
|
7
7
|
hanami-utils (~> 2.0.alpha3)
|
|
@@ -15,7 +15,7 @@ GEM
|
|
|
15
15
|
specs:
|
|
16
16
|
ast (2.4.2)
|
|
17
17
|
coderay (1.1.3)
|
|
18
|
-
concurrent-ruby (1.1.
|
|
18
|
+
concurrent-ruby (1.1.10)
|
|
19
19
|
deep_merge (1.2.2)
|
|
20
20
|
diff-lcs (1.5.0)
|
|
21
21
|
dry-transformer (0.1.1)
|
|
@@ -32,7 +32,7 @@ GEM
|
|
|
32
32
|
hansi (0.2.0)
|
|
33
33
|
json_refs (0.1.7)
|
|
34
34
|
hana
|
|
35
|
-
json_schemer (0.2.
|
|
35
|
+
json_schemer (0.2.19)
|
|
36
36
|
ecma-re-validator (~> 0.3)
|
|
37
37
|
hana (~> 1.3)
|
|
38
38
|
regexp_parser (~> 2.0)
|
|
@@ -87,6 +87,7 @@ GEM
|
|
|
87
87
|
uri_template (0.7.0)
|
|
88
88
|
|
|
89
89
|
PLATFORMS
|
|
90
|
+
arm64-darwin-21
|
|
90
91
|
x86_64-darwin-20
|
|
91
92
|
|
|
92
93
|
DEPENDENCIES
|
data/benchmarks/Gemfile.lock
CHANGED
|
@@ -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, raise_error: false)
|
|
14
14
|
@app = app
|
|
15
|
-
@raise =
|
|
15
|
+
@raise = raise_error
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def call(env) # rubocop:disable Metrics/AbcSize
|
data/lib/openapi_first/router.rb
CHANGED
|
@@ -7,13 +7,15 @@ module OpenapiFirst
|
|
|
7
7
|
class Router
|
|
8
8
|
def initialize(
|
|
9
9
|
app,
|
|
10
|
-
|
|
10
|
+
spec:,
|
|
11
|
+
raise_error: false,
|
|
12
|
+
not_found: :halt,
|
|
13
|
+
parent_app: nil
|
|
11
14
|
)
|
|
12
15
|
@app = app
|
|
13
|
-
@parent_app =
|
|
14
|
-
@raise =
|
|
15
|
-
@not_found =
|
|
16
|
-
spec = options.fetch(:spec)
|
|
16
|
+
@parent_app = parent_app
|
|
17
|
+
@raise = raise_error
|
|
18
|
+
@not_found = not_found
|
|
17
19
|
@filepath = spec.filepath
|
|
18
20
|
@router = build_router(spec.operations)
|
|
19
21
|
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.16.0
|
|
4
|
+
version: 0.16.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-
|
|
11
|
+
date: 2022-04-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: deep_merge
|
|
@@ -239,11 +239,11 @@ 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:
|
|
244
|
+
version: '0'
|
|
245
245
|
requirements: []
|
|
246
|
-
rubygems_version: 3.3.
|
|
246
|
+
rubygems_version: 3.3.7
|
|
247
247
|
signing_key:
|
|
248
248
|
specification_version: 4
|
|
249
249
|
summary: Implement REST APIs based on OpenApi.
|