swagger_docs_generator 0.3.4.pre.23 → 0.3.4.pre.26
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16439b96e401513da7c1b24f226900cc54f556f9
|
4
|
+
data.tar.gz: fe2b1a45da4edcfab260a90ed839cb09e242f6fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a80ac277a707e95d491d80b46343727c04ba82f56065aaf453eba64e750c30d4e655a9a9b4fe6c15b40bf224126d4dd590a0dbf7706126cf248969535f1e3dab
|
7
|
+
data.tar.gz: c785fe4001142af3f2dae4aa479a1ace7c975a728d171df32712afe35c26cbcd69acc32052d395fab4cf61f3ea1058ca39961257132addf94df087724559e241
|
@@ -18,7 +18,7 @@ module SwaggerDocsGenerator
|
|
18
18
|
# @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
|
19
19
|
class Configuration
|
20
20
|
# Accessors with default value
|
21
|
-
attr_accessor :swagger, :cleanning, :base_path
|
21
|
+
attr_accessor :swagger, :cleanning, :base_path, :compress
|
22
22
|
|
23
23
|
# Accessors without default value
|
24
24
|
attr_accessor :schemes, :consumes, :produces, :host, :external_docs,
|
@@ -29,6 +29,7 @@ module SwaggerDocsGenerator
|
|
29
29
|
@swagger = '2.0'
|
30
30
|
@base_path = '/'
|
31
31
|
@cleanning = true
|
32
|
+
@compress = false
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
@@ -26,8 +26,11 @@ module SwaggerDocsGenerator
|
|
26
26
|
def generate_swagger_file
|
27
27
|
delete_file_before
|
28
28
|
File.open(@swagger_file, 'a+') do |file|
|
29
|
-
|
30
|
-
|
29
|
+
file.puts = if SwaggerDocsGenerator.configure.compress
|
30
|
+
write_in_swagger_file.to_json
|
31
|
+
else
|
32
|
+
JSON.pretty_generate write_in_swagger_file
|
33
|
+
end
|
31
34
|
end
|
32
35
|
end
|
33
36
|
|