rspec-openapi 0.13.0 → 0.14.0

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: a5139294ebac456aadd2c09832f55cb214b7bf4ba9893919445823455cbee18a
4
- data.tar.gz: b77813ff2d18290e714482bfa45350f69b182a638162d083923acb9b21124cfe
3
+ metadata.gz: 032e7acfd3a1818b7bffc9130fb58116cc8f8e2045d40e426cabb9c47d37d323
4
+ data.tar.gz: 4dad6278000051a228fbe41f0210931411ddb119730055bd9262bd8dfd18ea23
5
5
  SHA512:
6
- metadata.gz: 58de63dbf9608beb5f313eb57e6e1e4386eefa23fd1b572d17b06319f571ca3c6b1ac172a7886b3dcd42e14feb1f5f60ebd5a532951441193f8400d66e5229ce
7
- data.tar.gz: 95765054acd231993f058a9f3a31a596c56ff143af9f1dc576bfb2f201773e611025329069b8c49751f50d3bf14b16a4f83ef863587d2f7815209f0afcdccb4a
6
+ metadata.gz: 75d7e8fb034bffdb1ed6d5dafbd1acdffd45d28db52bcb39c5606dad7bac41656415b2b0473a9aaed24bc2a9577ab9dd0bc8c413f547fabaaa5e4df7fe62f806
7
+ data.tar.gz: 2489d638c378f1f061ba992804761af38795a414535df628a5a3b419fcc73f11b116a23bb9d1a3f5a90f687fb30a70e220417463f75c33519194068440e155a2
data/README.md CHANGED
@@ -184,6 +184,12 @@ RSpec::OpenAPI.example_types = %i[request]
184
184
  # :controller and :action always exist. :format is added when routes is configured as such.
185
185
  RSpec::OpenAPI.ignored_path_params = %i[controller action format]
186
186
 
187
+ # Configure which paths to ignore.
188
+ # You can exclude some specs via `openapi: false`.
189
+ # But, in a complex API usage scenario, you may need to include spec itself, but exclude some private paths.
190
+ # In that case, you can specify the paths to ignore.
191
+ # String or Regexp is acceptable.
192
+ RSpec::OpenAPI.ignored_paths = ["/admin/full/path/", Regexp.new("^/_internal/")]
187
193
  ```
188
194
 
189
195
  ### Can I use rspec-openapi with `$ref` to minimize duplication of schema?
@@ -14,6 +14,8 @@ class << RSpec::OpenAPI::RecordBuilder = Object.new
14
14
  path, summary, tags, operation_id, required_request_params, raw_path_params, description, security =
15
15
  extract_request_attributes(request, example)
16
16
 
17
+ return if RSpec::OpenAPI.ignored_paths.any? { |ignored_path| path.match?(ignored_path) }
18
+
17
19
  request_headers, response_headers = extract_headers(request, response)
18
20
 
19
21
  RSpec::OpenAPI::Record.new(
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module OpenAPI
5
- VERSION = '0.13.0'
5
+ VERSION = '0.14.0'
6
6
  end
7
7
  end
data/lib/rspec/openapi.rb CHANGED
@@ -31,6 +31,7 @@ module RSpec::OpenAPI
31
31
  @response_headers = []
32
32
  @path_records = Hash.new { |h, k| h[k] = [] }
33
33
  @ignored_path_params = %i[controller action format]
34
+ @ignored_paths = []
34
35
 
35
36
  # This is the configuraion override file name we look for within each path.
36
37
  @config_filename = 'rspec_openapi.rb'
@@ -51,6 +52,7 @@ module RSpec::OpenAPI
51
52
  :example_types,
52
53
  :response_headers,
53
54
  :path_records,
55
+ :ignored_paths,
54
56
  :ignored_path_params
55
57
 
56
58
  attr_reader :config_filename
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-openapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-03-02 00:00:00.000000000 Z
12
+ date: 2024-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -88,7 +88,7 @@ licenses:
88
88
  metadata:
89
89
  homepage_uri: https://github.com/exoego/rspec-openapi
90
90
  source_code_uri: https://github.com/exoego/rspec-openapi
91
- changelog_uri: https://github.com/exoego/rspec-openapi/releases/tag/v0.13.0
91
+ changelog_uri: https://github.com/exoego/rspec-openapi/releases/tag/v0.14.0
92
92
  rubygems_mfa_required: 'true'
93
93
  post_install_message:
94
94
  rdoc_options: []