rspec-openapi 0.5.0 → 0.6.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: b35634b5756cb3719f38bdb5bbb501033b69472d0680615b5e1dcdba2251f41f
4
- data.tar.gz: 6600c602466bf0ea6a468c22a2762c6717086ed2ee1ae89c4d132b7d5edc21cc
3
+ metadata.gz: d9529f01aae2b2d1c77050b4a01f299c77a285057aa6fc7088a69ee7d2638e61
4
+ data.tar.gz: ca00d5561aaa0faeaadc1d42e7d2a25f729567b21af001c9677675e3738ae195
5
5
  SHA512:
6
- metadata.gz: 13c6e8ad06467426186336d53a387e7e92207d5caf5c6838a076275674e3f334a490185cbf20d889f59b04160d6ec056b3030e35862217d6425f88ccef7fc97c
7
- data.tar.gz: 4393d139ac38acd1ccf1b8404482671932b39491eed44ab69cbf57c28e06a186cdf452cb610b01377d2237f28ee4fe024fd43e28780b8662e8c76626be414332
6
+ metadata.gz: 5de0ee281ad93e679c8f5456769fc1569f51ebfe5408c884d7061f9c802e3f8578ad48799a71306a6ce7cf0aa76959b2e30e2c97956e98237d08745c13d7aa54
7
+ data.tar.gz: 0a0076cedb0633762235833ead555db74720fad22c9f03fa84a7cdeaba617a823117a508c5acdd2e518ac1660582849c94ab68ccaed629e8f109ecfefe64227c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## v0.6.1
2
+
3
+ * Stabilize the order parameter objects and preserve newer examples
4
+ [#59](https://github.com/k0kubun/rspec-openapi/pull/59)
5
+
6
+ ## v0.6.0
7
+
8
+ * Replace `RSpec::OpenAPI.server_urls` with `RSpec::OpenAPI.servers`
9
+ [#60](https://github.com/k0kubun/rspec-openapi/pull/60)
10
+
11
+ ## v0.5.1
12
+
13
+ * Clarify the version requirement for actionpack
14
+ [#62](https://github.com/k0kubun/rspec-openapi/pull/62)
15
+
1
16
  ## v0.5.0
2
17
 
3
18
  * Overwrite fields in an existing schema file instead of leaving all existing fields as is
data/Gemfile CHANGED
@@ -7,6 +7,10 @@ gem 'rails', ENV['RAILS_VERSION'] || '6.0.3.2'
7
7
  gem 'roda'
8
8
  gem 'rspec-rails'
9
9
 
10
+ group :test do
11
+ gem 'super_diff'
12
+ end
13
+
10
14
  group :development do
11
15
  gem 'pry'
12
16
  end
data/README.md CHANGED
@@ -140,10 +140,8 @@ RSpec::OpenAPI.info = {
140
140
  # Set `headers` - generate parameters with headers for a request
141
141
  RSpec::OpenAPI.request_headers = %w[X-Authorization-Token]
142
142
 
143
- # Set `server_urls` - generate servers of a schema file
144
- RSpec::OpenAPI.server_urls = %w[
145
- http://localhost:3000
146
- ]
143
+ # Set `servers` - generate servers of a schema file
144
+ RSpec::OpenAPI.servers = [{ url: 'http://localhost:3000' }]
147
145
 
148
146
  # Generate a comment on top of a schema file
149
147
  RSpec::OpenAPI.comment = <<~EOS
@@ -6,7 +6,7 @@ class << RSpec::OpenAPI::DefaultSchema = Object.new
6
6
  title: title,
7
7
  version: RSpec::OpenAPI.application_version,
8
8
  },
9
- servers: RSpec::OpenAPI.server_urls.map { |url| { url: url } } || [],
9
+ servers: RSpec::OpenAPI.servers,
10
10
  paths: {},
11
11
  }.freeze
12
12
  end
@@ -35,7 +35,7 @@ class << RSpec::OpenAPI::SchemaMerger = Object.new
35
35
  elsif base[key].is_a?(Array) && value.is_a?(Array)
36
36
  # parameters need to be merged as if `name` and `in` were the Hash keys.
37
37
  if key == 'parameters'
38
- base[key] |= value
38
+ base[key] = value | base[key]
39
39
  base[key].uniq! { |param| param.slice('name', 'in') }
40
40
  else
41
41
  base[key] = value
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module OpenAPI
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.1'
4
4
  end
5
5
  end
data/lib/rspec/openapi.rb CHANGED
@@ -9,10 +9,10 @@ module RSpec::OpenAPI
9
9
  @info = {}
10
10
  @application_version = '1.0.0'
11
11
  @request_headers = []
12
- @server_urls = []
12
+ @servers = []
13
13
  @example_types = %i[request]
14
14
 
15
15
  class << self
16
- attr_accessor :path, :comment, :enable_example, :description_builder, :info, :application_version, :request_headers, :server_urls, :example_types
16
+ attr_accessor :path, :comment, :enable_example, :description_builder, :info, :application_version, :request_headers, :servers, :example_types
17
17
  end
18
18
  end
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.add_dependency 'actionpack'
26
+ spec.add_dependency 'actionpack', '>= 5.2.0'
27
27
  spec.add_dependency 'rspec'
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-openapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-19 00:00:00.000000000 Z
11
+ date: 2022-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 5.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 5.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.1.2
92
+ rubygems_version: 3.3.7
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Generate OpenAPI schema from RSpec request specs