rspec-openapi 0.13.0 → 0.14.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/README.md +6 -0
- data/lib/rspec/openapi/record_builder.rb +2 -0
- data/lib/rspec/openapi/version.rb +1 -1
- data/lib/rspec/openapi.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 032e7acfd3a1818b7bffc9130fb58116cc8f8e2045d40e426cabb9c47d37d323
|
4
|
+
data.tar.gz: 4dad6278000051a228fbe41f0210931411ddb119730055bd9262bd8dfd18ea23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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.
|
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-
|
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.
|
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: []
|