openapi_first 0.15.0 → 0.16.1

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: 8731ef9a6d84febb76130138b1ee24230b37483d3f1b0ef52462be9352b9d7d8
4
+ data.tar.gz: 2014645e888cb1a69426dc53685ba4b839c53c33d8104aca3e06f9f4a32c6967
5
5
  SHA512:
6
- metadata.gz: 65b51042f045570f3f357108aee08519be8e0f0b0ca2b997fa4ba3bbb49bd4febb98a28efb624f6cacd41074383c7b8920748c2997fe5d943108d3d72db5194e
7
- data.tar.gz: 9188f1624b57d2eb5eea004bef5b086037681603a7dc788b1810faa42b44005360663326d81aa53ba549442c8667fef6b4830dfc542f7f39e77c011db25f01f2
6
+ metadata.gz: c9dccec4ed7d325c9d4a54e5a306c3b9c95594c7d74c2c72d6ce9d1ecea8ac58963157318ad80ee5c264571ae0b0be127a06ec93568025f51f36d22540c75233
7
+ data.tar.gz: 0d3cf94cc1ef77e89b33ea59523898352498202d5b4458e419f116de55d7b66d569311e1563f069bc4c923b7f7db46712c74fee3fa714125acfa2baf15581859
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.1
4
+
5
+ - Pin hanami-router version, because alpha6 is broken.
6
+
7
+ ## 0.16.0
8
+
9
+ - Support status code wildcards like "2XX", "4XX"
10
+
3
11
  ## 0.15.0
4
12
 
5
13
  - Populate default parameter values
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openapi_first (0.15.0)
4
+ openapi_first (0.16.1)
5
5
  deep_merge (>= 1.2.1)
6
- hanami-router (~> 2.0.alpha5)
7
- hanami-utils (~> 2.0.alpha3)
6
+ hanami-router (= 2.0.alpha5)
7
+ hanami-utils (= 2.0.alpha3)
8
8
  json_refs (>= 0.1.7)
9
9
  json_schemer (~> 0.2.16)
10
10
  multi_json (~> 1.14)
@@ -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.9)
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.18)
35
+ json_schemer (0.2.20)
36
36
  ecma-re-validator (~> 0.3)
37
37
  hana (~> 1.3)
38
38
  regexp_parser (~> 2.0)
@@ -44,8 +44,8 @@ GEM
44
44
  mustermann-contrib (1.1.1)
45
45
  hansi (~> 0.2.0)
46
46
  mustermann (= 1.1.1)
47
- parallel (1.21.0)
48
- parser (3.1.0.0)
47
+ parallel (1.22.1)
48
+ parser (3.1.1.0)
49
49
  ast (~> 2.4.1)
50
50
  pry (0.14.1)
51
51
  coderay (~> 1.1)
@@ -66,27 +66,28 @@ GEM
66
66
  rspec-expectations (3.11.0)
67
67
  diff-lcs (>= 1.2.0, < 2.0)
68
68
  rspec-support (~> 3.11.0)
69
- rspec-mocks (3.11.0)
69
+ rspec-mocks (3.11.1)
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.25.1)
73
+ rubocop (1.26.1)
74
74
  parallel (~> 1.10)
75
75
  parser (>= 3.1.0.0)
76
76
  rainbow (>= 2.2.2, < 4.0)
77
77
  regexp_parser (>= 1.8, < 3.0)
78
78
  rexml
79
- rubocop-ast (>= 1.15.1, < 2.0)
79
+ rubocop-ast (>= 1.16.0, < 2.0)
80
80
  ruby-progressbar (~> 1.7)
81
81
  unicode-display_width (>= 1.4.0, < 3.0)
82
- rubocop-ast (1.15.2)
83
- parser (>= 3.0.1.1)
82
+ rubocop-ast (1.16.0)
83
+ parser (>= 3.1.1.0)
84
84
  ruby-progressbar (1.11.0)
85
85
  ruby2_keywords (0.0.5)
86
86
  unicode-display_width (2.1.0)
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 CHANGED
@@ -10,5 +10,6 @@ gem 'hanami-api'
10
10
  gem 'hanami-router', '~> 2.0.0.alpha5'
11
11
  gem 'multi_json'
12
12
  gem 'openapi_first', path: '../'
13
+ gem 'roda'
13
14
  gem 'sinatra'
14
15
  gem 'syro'
@@ -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)
5
5
  deep_merge (>= 1.2.1)
6
6
  hanami-router (~> 2.0.alpha5)
7
7
  hanami-utils (~> 2.0.alpha3)
@@ -72,7 +72,7 @@ GEM
72
72
  json_refs (0.1.7)
73
73
  hana
74
74
  json_schema (0.21.0)
75
- json_schemer (0.2.18)
75
+ json_schemer (0.2.20)
76
76
  ecma-re-validator (~> 0.3)
77
77
  hana (~> 1.3)
78
78
  regexp_parser (~> 2.0)
@@ -94,6 +94,8 @@ GEM
94
94
  rack-protection (2.1.0)
95
95
  rack
96
96
  regexp_parser (2.2.1)
97
+ roda (3.54.0)
98
+ rack
97
99
  ruby2_keywords (0.0.5)
98
100
  seg (1.2.0)
99
101
  sinatra (2.1.0)
@@ -110,6 +112,7 @@ GEM
110
112
  uri_template (0.7.0)
111
113
 
112
114
  PLATFORMS
115
+ arm64-darwin-21
113
116
  x86_64-darwin-20
114
117
 
115
118
  DEPENDENCIES
@@ -121,6 +124,7 @@ DEPENDENCIES
121
124
  hanami-router (~> 2.0.0.alpha5)
122
125
  multi_json
123
126
  openapi_first!
127
+ roda
124
128
  sinatra
125
129
  syro
126
130
 
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'roda'
4
+ require 'multi_json'
5
+
6
+ class App < Roda
7
+ route do |r|
8
+ r.on 'hello' do
9
+ r.on :id do
10
+ r.get do
11
+ MultiJson.dump({ hello: 'world', id: r.params[:id] })
12
+ end
13
+ end
14
+
15
+ r.get do
16
+ MultiJson.dump([{ hello: 'world' }])
17
+ end
18
+
19
+ r.post do
20
+ response.status = 201
21
+ MultiJson.dump({ hello: 'world' })
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+ run App.freeze.app
@@ -93,6 +93,7 @@ module OpenapiFirst
93
93
 
94
94
  def response_by_code(status)
95
95
  operation_object.dig('responses', status.to_s) ||
96
+ operation_object.dig('responses', "#{status / 100}XX") ||
96
97
  operation_object.dig('responses', 'default')
97
98
  end
98
99
 
@@ -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.1'
5
5
  end
@@ -35,8 +35,8 @@ Gem::Specification.new do |spec|
35
35
  spec.required_ruby_version = '>= 2.6.0'
36
36
 
37
37
  spec.add_runtime_dependency 'deep_merge', '>= 1.2.1'
38
- spec.add_runtime_dependency 'hanami-router', '~> 2.0.alpha5'
39
- spec.add_runtime_dependency 'hanami-utils', '~> 2.0.alpha3'
38
+ spec.add_runtime_dependency 'hanami-router', '2.0.alpha5'
39
+ spec.add_runtime_dependency 'hanami-utils', '2.0.alpha3'
40
40
  spec.add_runtime_dependency 'json_refs', '>= 0.1.7'
41
41
  spec.add_runtime_dependency 'json_schemer', '~> 0.2.16'
42
42
  spec.add_runtime_dependency 'multi_json', '~> 1.14'
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.1
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-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge
@@ -28,28 +28,28 @@ dependencies:
28
28
  name: hanami-router
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.0.alpha5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.0.alpha5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hanami-utils
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.0.alpha3
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.0.alpha3
55
55
  - !ruby/object:Gem::Dependency
@@ -194,6 +194,7 @@ files:
194
194
  - benchmarks/apps/openapi_first.ru
195
195
  - benchmarks/apps/openapi_first_with_hanami_api.ru
196
196
  - benchmarks/apps/openapi_first_with_response_validation.ru
197
+ - benchmarks/apps/roda.ru
197
198
  - benchmarks/apps/sinatra.ru
198
199
  - benchmarks/apps/syro.ru
199
200
  - benchmarks/benchmarks.rb
@@ -243,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
244
  - !ruby/object:Gem::Version
244
245
  version: '0'
245
246
  requirements: []
246
- rubygems_version: 3.3.3
247
+ rubygems_version: 3.3.7
247
248
  signing_key:
248
249
  specification_version: 4
249
250
  summary: Implement REST APIs based on OpenApi.