rspec-openapi 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +9 -0
- data/lib/rspec/openapi/hooks.rb +3 -1
- data/lib/rspec/openapi/version.rb +1 -1
- data/lib/rspec/openapi.rb +2 -1
- 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: 91fc5996b0273d0dd4a7e0261b86902db52e7a64c1433bbcb8cf107abf5d3784
|
4
|
+
data.tar.gz: 342051d1e3b6bb7a81af2f46fbb75b4c99658bf9cb075359104b6e2feef09985
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0445f41450ef4cfa70548431356aea9dc94abe0a18a6b5132398f63db7c5c46eaf1a572ee41cdf234ed864d0aba490a51abfb36859edc637f4098c32c8ef39c1
|
7
|
+
data.tar.gz: 5b318c2f1bec7f0608b89ab6cda871f4dddf6e8e2a2c7bd6dfed8430bb28597b97733bb34f1e03ee5fa0100170fedb0e47545b082b787e24e22e0e98a471591b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -126,6 +126,15 @@ RSpec::OpenAPI.enable_example = false
|
|
126
126
|
# Change `info.version`
|
127
127
|
RSpec::OpenAPI.application_version = '1.0.0'
|
128
128
|
|
129
|
+
# Set the info header details
|
130
|
+
RSpec::OpenAPI.info = {
|
131
|
+
description: 'My beautiful API',
|
132
|
+
license: {
|
133
|
+
'name': 'Apache 2.0',
|
134
|
+
'url': 'https://www.apache.org/licenses/LICENSE-2.0.html'
|
135
|
+
}
|
136
|
+
}
|
137
|
+
|
129
138
|
# Set `headers` - generate parameters with headers for a request
|
130
139
|
RSpec::OpenAPI.request_headers = %w[X-Authorization-Token]
|
131
140
|
|
data/lib/rspec/openapi/hooks.rb
CHANGED
@@ -20,7 +20,9 @@ RSpec.configuration.after(:suite) do
|
|
20
20
|
title = File.basename(Dir.pwd)
|
21
21
|
path_records.each do |path, records|
|
22
22
|
RSpec::OpenAPI::SchemaFile.new(path).edit do |spec|
|
23
|
-
|
23
|
+
schema = RSpec::OpenAPI::DefaultSchema.build(title)
|
24
|
+
schema[:info].merge!(RSpec::OpenAPI.info)
|
25
|
+
RSpec::OpenAPI::SchemaMerger.reverse_merge!(spec, schema)
|
24
26
|
records.each do |record|
|
25
27
|
begin
|
26
28
|
RSpec::OpenAPI::SchemaMerger.reverse_merge!(spec, RSpec::OpenAPI::SchemaBuilder.build(record))
|
data/lib/rspec/openapi.rb
CHANGED
@@ -6,12 +6,13 @@ module RSpec::OpenAPI
|
|
6
6
|
@comment = nil
|
7
7
|
@enable_example = true
|
8
8
|
@description_builder = -> (example) { example.description }
|
9
|
+
@info = {}
|
9
10
|
@application_version = '1.0.0'
|
10
11
|
@request_headers = []
|
11
12
|
@server_urls = []
|
12
13
|
@example_types = %i[request]
|
13
14
|
|
14
15
|
class << self
|
15
|
-
attr_accessor :path, :comment, :enable_example, :description_builder, :application_version, :request_headers, :server_urls, :example_types
|
16
|
+
attr_accessor :path, :comment, :enable_example, :description_builder, :info, :application_version, :request_headers, :server_urls, :example_types
|
16
17
|
end
|
17
18
|
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.4.
|
4
|
+
version: 0.4.7
|
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-03-
|
11
|
+
date: 2022-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
rubygems_version: 3.
|
93
|
+
rubygems_version: 3.3.7
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Generate OpenAPI schema from RSpec request specs
|