swagger_ui_engine_rails7 1.2.1 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Rakefile +1 -1
- data/app/controllers/swagger_ui_engine/application_controller.rb +2 -2
- data/app/controllers/swagger_ui_engine/swagger_docs_controller.rb +7 -7
- data/app/helpers/swagger_ui_engine/auth_config_parser.rb +2 -2
- data/app/helpers/swagger_ui_engine/config_parser.rb +4 -4
- data/app/helpers/swagger_ui_engine/oauth_config_parser.rb +2 -2
- data/app/helpers/swagger_ui_engine/translation_helper.rb +2 -2
- data/lib/swagger_ui_engine_rails7/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b9f331b0efd12fadf3baeaca7f563d33655d83a49679b69a0796a5b3e5d4129
|
4
|
+
data.tar.gz: 27b7a810911bc5fdc7267f9baa94eeb8fac02f604a7753b2960d79fae41e9b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 046570bcbc8ff642a2f6cd896f318146cc89df8d8ebf738dcac90097fceb234cb89638e6122500876b4e044c115861599e09a642a31761e0426bc601a3ee5431
|
7
|
+
data.tar.gz: 7bd7bf883de05453efc8e4f92b7d8a2fc199a14909f385c65ff36ab80d64be1f031c19c0d53d5e823cbb33cca0aed779930fb6ef39a84ec93adfe41977505dc0
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -19,7 +19,7 @@ end
|
|
19
19
|
|
20
20
|
RDoc::Task.new(:rdoc) do |rdoc|
|
21
21
|
rdoc.rdoc_dir = 'rdoc'
|
22
|
-
rdoc.title = '
|
22
|
+
rdoc.title = 'SwaggerUiEngineRails7'
|
23
23
|
rdoc.options << '--line-numbers'
|
24
24
|
rdoc.rdoc_files.include('README.rdoc')
|
25
25
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module
|
2
|
-
class SwaggerDocsController <
|
3
|
-
include
|
4
|
-
include
|
1
|
+
module SwaggerUiEngineRails7
|
2
|
+
class SwaggerDocsController < SwaggerUiEngineRails7::ApplicationController
|
3
|
+
include SwaggerUiEngineRails7::ConfigParser
|
4
|
+
include SwaggerUiEngineRails7::OauthConfigParser
|
5
5
|
|
6
|
-
helper
|
6
|
+
helper SwaggerUiEngineRails7::TranslationHelper
|
7
7
|
layout 'swagger_ui_engine/layouts/swagger', except: %w(oauth2)
|
8
8
|
|
9
9
|
before_action :set_configs, :set_oauth_configs
|
@@ -29,13 +29,13 @@ module SwaggerUiEngine
|
|
29
29
|
private
|
30
30
|
|
31
31
|
def set_configs
|
32
|
-
|
32
|
+
SwaggerUiEngineRails7::DEFAULTS.keys.each do |key|
|
33
33
|
instance_variable_set("@#{key}", self.send("set_#{key}"))
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
def set_oauth_configs
|
38
|
-
|
38
|
+
SwaggerUiEngineRails7::OAUTH2_DEFAULTS.keys.each do |key|
|
39
39
|
instance_variable_set("@#{key}", self.send("set_#{key}"))
|
40
40
|
end
|
41
41
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SwaggerUiEngineRails7
|
2
2
|
module AuthConfigParser
|
3
3
|
def admin_username
|
4
4
|
configuration.admin_username
|
@@ -13,7 +13,7 @@ module SwaggerUiEngine
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def configuration
|
16
|
-
|
16
|
+
SwaggerUiEngineRails7.configuration
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
1
|
+
module SwaggerUiEngineRails7
|
2
2
|
module ConfigParser
|
3
|
-
|
3
|
+
SwaggerUiEngineRails7::DEFAULTS.each do |default|
|
4
4
|
next if default.first.to_s.eql?('validator_url')
|
5
5
|
|
6
6
|
define_method("set_#{default.first}") do
|
@@ -12,7 +12,7 @@ module SwaggerUiEngine
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def set_validator_url
|
15
|
-
validator_enabled? ?
|
15
|
+
validator_enabled? ? SwaggerUiEngineRails7::DEFAULTS[:validator_url] : 'null'
|
16
16
|
end
|
17
17
|
|
18
18
|
def validator_enabled?
|
@@ -20,7 +20,7 @@ module SwaggerUiEngine
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def configuration
|
23
|
-
|
23
|
+
SwaggerUiEngineRails7.configuration
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
1
|
+
module SwaggerUiEngineRails7
|
2
2
|
module OauthConfigParser
|
3
|
-
|
3
|
+
SwaggerUiEngineRails7::OAUTH2_DEFAULTS.each do |default|
|
4
4
|
define_method("set_#{default.first}") do
|
5
5
|
# set_oauth_app_name set_oauth_client_id
|
6
6
|
# set_oauth_client_secret set_oauth_realm
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SwaggerUiEngineRails7
|
2
2
|
module TranslationHelper
|
3
3
|
def load_translation_file
|
4
4
|
return unless translator_enabled?
|
@@ -10,7 +10,7 @@ module SwaggerUiEngine
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def translator_enabled?
|
13
|
-
|
13
|
+
SwaggerUiEngineRails7.configuration.translator_enabled
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|