rspec_api_documentation-open_api 0.2.1 → 0.2.2
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dd0494e891fbd0fee7a0103bcfae6a13bc696e97805bf087cbf759e5c55f8275
|
|
4
|
+
data.tar.gz: 5f945c77b66e94560cd627bba6890bbc8abdc4708a05f1aa89f23ca709f08a20
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 26b079ad9a3e6d87cc17d6164dd488bd1fddb3d1ee970726c8ee48fc4b00507967a76f13f8a07b80aee98d5e52f0b82adc3abef98fa3ae5ed84ebd1bb28b7191
|
|
7
|
+
data.tar.gz: ab2b1d2612725ea551d24507b52bf3fcc954d8c462556f46adb2038e05319065202c094a5a29b6688cc1ca0209222aadb7a23c9ce3f65795bd0e6889837cbcb8
|
data/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
require "rspec_api_documentation"
|
|
1
2
|
require "rspec_api_documentation/open_api/version"
|
|
2
3
|
|
|
3
4
|
module RspecApiDocumentation
|
|
4
5
|
module Writers
|
|
5
6
|
extend ActiveSupport::Autoload
|
|
7
|
+
RspecApiDocumentation::Configuration.add_setting :open_api, default: {}
|
|
6
8
|
|
|
7
9
|
autoload :OpenApiWriter
|
|
8
10
|
autoload :OpenApiJsonWriter
|
|
@@ -8,8 +8,6 @@ module RspecApiDocumentation
|
|
|
8
8
|
class OpenApiWriter < Writer
|
|
9
9
|
attr_writer :types, :swagger
|
|
10
10
|
|
|
11
|
-
RspecApiDocumentation::Configuration.add_setting :open_api, default: {}
|
|
12
|
-
|
|
13
11
|
def write
|
|
14
12
|
File.open(configuration.docs_dir.join("open_api.json"), "w") do |f|
|
|
15
13
|
f.write JSON.pretty_generate(get_hash)
|
|
@@ -243,7 +241,7 @@ module RspecApiDocumentation
|
|
|
243
241
|
end
|
|
244
242
|
|
|
245
243
|
def info
|
|
246
|
-
RspecApiDocumentation.configuration.open_api["
|
|
244
|
+
RspecApiDocumentation.configuration.open_api["info"] || {
|
|
247
245
|
"version" => "1.0.0",
|
|
248
246
|
"title" => "Open API",
|
|
249
247
|
"description" => "Open API",
|
|
@@ -254,7 +252,7 @@ module RspecApiDocumentation
|
|
|
254
252
|
end
|
|
255
253
|
|
|
256
254
|
def servers
|
|
257
|
-
RspecApiDocumentation.configuration.open_api["
|
|
255
|
+
RspecApiDocumentation.configuration.open_api["servers"] || [
|
|
258
256
|
{
|
|
259
257
|
"url" => "http://localhost:{port}",
|
|
260
258
|
"description" => "Development server",
|