oas_rails 1.1.1 → 1.2.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/app/helpers/oas_rails/oas_rails_helper.rb +17 -0
- data/app/views/oas_rails/oas_rails/index.html.erb +7 -11
- data/lib/generators/oas_rails/config/templates/oas_rails_initializer.rb +8 -0
- data/lib/oas_rails/configuration.rb +3 -1
- data/lib/oas_rails/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: 5b7344f0f77c27f3d15b8ba5030664685973d74faa4ff2d23821967c66d0495b
|
4
|
+
data.tar.gz: c22ebcb019a8071cd89abf80a6170d45e451b9c2e24645f7f958d498b2b390ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 580e32391f327d90e64bb504976a974971b2acdb6cd93a4a5a18efcb4d9f6395c5371522aa3db2e81d95ca4fa2b3fc24f4e4cd8f46b1e15228d934aae3366a2d
|
7
|
+
data.tar.gz: 18d129900f968958d2b76e1ede4ec650e91f8a8678fe52a94a1c30ec74904e3c4c6d736c0fd8a83c8dae2eea08736e1de7eefebe40b793530a43f727fb8cb35e
|
@@ -1,4 +1,21 @@
|
|
1
1
|
module OasRails
|
2
2
|
module OasRailsHelper
|
3
|
+
def rapidoc_configuration_attributes
|
4
|
+
{
|
5
|
+
"spec-url" => "#{OasRails::Engine.routes.find_script_name({})}.json",
|
6
|
+
"show-header" => "false",
|
7
|
+
"font-size" => "largest",
|
8
|
+
"show-method-in-nav-bar" => "as-colored-text",
|
9
|
+
"nav-item-spacing" => "relaxed",
|
10
|
+
"allow-spec-file-download" => "true",
|
11
|
+
"schema-style" => "table",
|
12
|
+
"sort-tags" => "true",
|
13
|
+
"persist-auth" => "true"
|
14
|
+
}.merge(OasRails.config.rapidoc_configuration).map { |k, v| %(#{k}=#{ERB::Util.html_escape(v)}) }.join(' ')
|
15
|
+
end
|
16
|
+
|
17
|
+
def rapidoc_logo_url
|
18
|
+
OasRails.config.rapidoc_logo_url
|
19
|
+
end
|
3
20
|
end
|
4
21
|
end
|
@@ -125,17 +125,13 @@
|
|
125
125
|
</script>
|
126
126
|
</head>
|
127
127
|
<body>
|
128
|
-
<rapi-doc
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
schema-style="table"
|
136
|
-
sort-tags="true"
|
137
|
-
persist-auth="true"
|
138
|
-
>
|
128
|
+
<rapi-doc <%= rapidoc_configuration_attributes %> >
|
129
|
+
<% if rapidoc_logo_url %>
|
130
|
+
<img
|
131
|
+
slot="nav-logo"
|
132
|
+
src="<%= rapidoc_logo_url %>"
|
133
|
+
/>
|
134
|
+
<% end %>
|
139
135
|
</rapi-doc>
|
140
136
|
|
141
137
|
<style>
|
@@ -70,6 +70,14 @@ OasRails.configure do |config|
|
|
70
70
|
# Default: false
|
71
71
|
# config.layout = "application"
|
72
72
|
|
73
|
+
# Override general rapi-doc settings
|
74
|
+
# config.rapidoc_configuration
|
75
|
+
# default: {}
|
76
|
+
|
77
|
+
# Add a logo to rapi-doc
|
78
|
+
# config.rapidoc_logo_url
|
79
|
+
# default: nil
|
80
|
+
|
73
81
|
# Excluding custom controllers or controllers#action
|
74
82
|
# Example: ["projects", "users#new"]
|
75
83
|
# config.ignored_actions = []
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module OasRails
|
2
2
|
class Configuration < OasCore::Configuration
|
3
|
-
attr_accessor :autodiscover_request_body, :autodiscover_responses, :ignored_actions, :rapidoc_theme, :layout, :source_oas_path
|
3
|
+
attr_accessor :autodiscover_request_body, :autodiscover_responses, :ignored_actions, :rapidoc_theme, :layout, :source_oas_path, :rapidoc_configuration, :rapidoc_logo_url
|
4
4
|
attr_reader :route_extractor, :include_mode
|
5
5
|
|
6
6
|
def initialize
|
@@ -12,6 +12,8 @@ module OasRails
|
|
12
12
|
@ignored_actions = []
|
13
13
|
@rapidoc_theme = :rails
|
14
14
|
@layout = nil
|
15
|
+
@rapidoc_configuration = {}
|
16
|
+
@rapidoc_logo_url = nil
|
15
17
|
@source_oas_path = nil
|
16
18
|
|
17
19
|
# TODO: implement
|
data/lib/oas_rails/version.rb
CHANGED