swagger_ui_rails_engine 0.0.0.1
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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +52 -0
- data/Rakefile +19 -0
- data/app/assets/config/swagger_ui_rails_engine_manifest.js +2 -0
- data/app/assets/javascripts/swagger_ui_rails_engine/application.js +16 -0
- data/app/assets/javascripts/swagger_ui_rails_engine/swagger-ui-bundle.js +134 -0
- data/app/assets/javascripts/swagger_ui_rails_engine/swagger-ui-bundle.js.map +1 -0
- data/app/assets/javascripts/swagger_ui_rails_engine/swagger-ui-standalone-preset.js +22 -0
- data/app/assets/javascripts/swagger_ui_rails_engine/swagger-ui-standalone-preset.js.map +1 -0
- data/app/assets/javascripts/swagger_ui_rails_engine/swagger-ui.js +9 -0
- data/app/assets/javascripts/swagger_ui_rails_engine/swagger-ui.js.map +1 -0
- data/app/assets/javascripts/swagger_ui_rails_engine/swagger_ui_rails_engine/swagger_docs_controller.js +2 -0
- data/app/assets/stylesheets/swagger-ui.css +4 -0
- data/app/assets/stylesheets/swagger-ui.css.map +1 -0
- data/app/assets/stylesheets/swagger_ui_rails_engine/application.css +34 -0
- data/app/assets/stylesheets/swagger_ui_rails_engine/swagger-ui.css +4 -0
- data/app/assets/stylesheets/swagger_ui_rails_engine/swagger_ui_rails_engine/swagger_docs_controller.css +4 -0
- data/app/controllers/swagger_ui_rails_engine/application_controller.rb +5 -0
- data/app/controllers/swagger_ui_rails_engine/swagger_docs_controller.rb +36 -0
- data/app/helpers/swagger_ui_rails_engine/application_helper.rb +4 -0
- data/app/helpers/swagger_ui_rails_engine/config_parser.rb +26 -0
- data/app/jobs/swagger_ui_rails_engine/application_job.rb +4 -0
- data/app/mailers/swagger_ui_rails_engine/application_mailer.rb +6 -0
- data/app/models/swagger_ui_rails_engine/application_record.rb +5 -0
- data/app/views/swagger_ui_rails_engine/layouts/swagger.html.erb +18 -0
- data/app/views/swagger_ui_rails_engine/swagger_docs/index.html.erb +22 -0
- data/app/views/swagger_ui_rails_engine/swagger_docs/show.html.erb +22 -0
- data/config/routes.rb +3 -0
- data/lib/swagger_ui_rails_engine.rb +18 -0
- data/lib/swagger_ui_rails_engine/configuration.rb +24 -0
- data/lib/swagger_ui_rails_engine/defaults.rb +19 -0
- data/lib/swagger_ui_rails_engine/engine.rb +5 -0
- data/lib/swagger_ui_rails_engine/version.rb +3 -0
- data/lib/tasks/swagger_ui_rails_engine_tasks.rake +4 -0
- metadata +97 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Swagger ui rails engine</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag "swagger_ui_rails_engine/application", media: "all" %>
|
9
|
+
<%= javascript_include_tag "swagger_ui_rails_engine/application" %>
|
10
|
+
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<div id="swagger-ui"></div>
|
14
|
+
|
15
|
+
<%= yield %>
|
16
|
+
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<script>
|
2
|
+
window.onload = function () {
|
3
|
+
// Begin Swagger UI call region
|
4
|
+
|
5
|
+
SwaggerUIBundle({
|
6
|
+
url: "<%=@swagger_url %>",
|
7
|
+
dom_id: '#swagger-ui',
|
8
|
+
deepLinking: true,
|
9
|
+
presets: [
|
10
|
+
SwaggerUIBundle.presets.apis,
|
11
|
+
SwaggerUIStandalonePreset
|
12
|
+
],
|
13
|
+
plugins: [
|
14
|
+
SwaggerUIBundle.plugins.DownloadUrl
|
15
|
+
],
|
16
|
+
layout: "StandaloneLayout"
|
17
|
+
})
|
18
|
+
// End Swagger UI call region
|
19
|
+
|
20
|
+
window.ui = ui
|
21
|
+
}
|
22
|
+
</script>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<script>
|
2
|
+
window.onload = function () {
|
3
|
+
// Begin Swagger UI call region
|
4
|
+
const app = SwaggerUIBundle({
|
5
|
+
url: "<%=@swagger_url %>",
|
6
|
+
dom_id: '#swagger-ui',
|
7
|
+
deepLinking: true,
|
8
|
+
presets: [
|
9
|
+
SwaggerUIBundle.presets.apis,
|
10
|
+
SwaggerUIStandalonePreset
|
11
|
+
],
|
12
|
+
plugins: [
|
13
|
+
SwaggerUIBundle.plugins.DownloadUrl
|
14
|
+
],
|
15
|
+
docExpansion: "none",
|
16
|
+
layout: "StandaloneLayout",
|
17
|
+
})
|
18
|
+
// End Swagger UI call region
|
19
|
+
|
20
|
+
window.ui = ui
|
21
|
+
}
|
22
|
+
</script>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require "swagger_ui_rails_engine/engine"
|
2
|
+
require 'swagger_ui_rails_engine/engine'
|
3
|
+
require 'swagger_ui_rails_engine/version'
|
4
|
+
require 'swagger_ui_rails_engine/configuration'
|
5
|
+
require 'swagger_ui_rails_engine/defaults'
|
6
|
+
module SwaggerUiRailsEngine
|
7
|
+
class << self
|
8
|
+
delegate(*Configuration::OPTIONS, to: :configuration)
|
9
|
+
|
10
|
+
def configuration
|
11
|
+
@configuration ||= Configuration.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def configure
|
15
|
+
yield configuration
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module SwaggerUiRailsEngine
|
2
|
+
class Configuration
|
3
|
+
# Configurable options
|
4
|
+
OPTIONS = %i(
|
5
|
+
admin_username
|
6
|
+
admin_password
|
7
|
+
doc_expansion
|
8
|
+
json_editor
|
9
|
+
model_rendering
|
10
|
+
oauth_client_id
|
11
|
+
oauth_client_secret
|
12
|
+
oauth_realm
|
13
|
+
oauth_app_name
|
14
|
+
oauth_scope_separator
|
15
|
+
oauth_query_string_params
|
16
|
+
request_headers
|
17
|
+
swagger_url
|
18
|
+
translator_enabled
|
19
|
+
validator_enabled
|
20
|
+
).freeze
|
21
|
+
|
22
|
+
attr_accessor(*OPTIONS)
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module SwaggerUiRailsEngine
|
2
|
+
DEFAULTS = {
|
3
|
+
swagger_url: 'http://petstore.swagger.io/v2/swagger.json',
|
4
|
+
doc_expansion: 'none',
|
5
|
+
json_editor: false,
|
6
|
+
model_rendering: 'schema',
|
7
|
+
request_headers: false,
|
8
|
+
validator_url: '//online.swagger.io/validator'
|
9
|
+
}.freeze
|
10
|
+
|
11
|
+
OAUTH2_DEFAULTS = {
|
12
|
+
oauth_app_name: 'your-app-name',
|
13
|
+
oauth_client_id: 'your-client-id',
|
14
|
+
oauth_client_secret: 'your-client-secret-if-required',
|
15
|
+
oauth_realm: 'your-realms',
|
16
|
+
oauth_scope_separator: ' ',
|
17
|
+
oauth_query_string_params: {}
|
18
|
+
}.freeze
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: swagger_ui_rails_engine
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Cosmin Barbu
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-09-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '4.2'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7'
|
33
|
+
description: Wrapper over swagger ui
|
34
|
+
email:
|
35
|
+
- bacosmin@gmail.com
|
36
|
+
executables: []
|
37
|
+
extensions: []
|
38
|
+
extra_rdoc_files: []
|
39
|
+
files:
|
40
|
+
- MIT-LICENSE
|
41
|
+
- README.md
|
42
|
+
- Rakefile
|
43
|
+
- app/assets/config/swagger_ui_rails_engine_manifest.js
|
44
|
+
- app/assets/javascripts/swagger_ui_rails_engine/application.js
|
45
|
+
- app/assets/javascripts/swagger_ui_rails_engine/swagger-ui-bundle.js
|
46
|
+
- app/assets/javascripts/swagger_ui_rails_engine/swagger-ui-bundle.js.map
|
47
|
+
- app/assets/javascripts/swagger_ui_rails_engine/swagger-ui-standalone-preset.js
|
48
|
+
- app/assets/javascripts/swagger_ui_rails_engine/swagger-ui-standalone-preset.js.map
|
49
|
+
- app/assets/javascripts/swagger_ui_rails_engine/swagger-ui.js
|
50
|
+
- app/assets/javascripts/swagger_ui_rails_engine/swagger-ui.js.map
|
51
|
+
- app/assets/javascripts/swagger_ui_rails_engine/swagger_ui_rails_engine/swagger_docs_controller.js
|
52
|
+
- app/assets/stylesheets/swagger-ui.css
|
53
|
+
- app/assets/stylesheets/swagger-ui.css.map
|
54
|
+
- app/assets/stylesheets/swagger_ui_rails_engine/application.css
|
55
|
+
- app/assets/stylesheets/swagger_ui_rails_engine/swagger-ui.css
|
56
|
+
- app/assets/stylesheets/swagger_ui_rails_engine/swagger_ui_rails_engine/swagger_docs_controller.css
|
57
|
+
- app/controllers/swagger_ui_rails_engine/application_controller.rb
|
58
|
+
- app/controllers/swagger_ui_rails_engine/swagger_docs_controller.rb
|
59
|
+
- app/helpers/swagger_ui_rails_engine/application_helper.rb
|
60
|
+
- app/helpers/swagger_ui_rails_engine/config_parser.rb
|
61
|
+
- app/jobs/swagger_ui_rails_engine/application_job.rb
|
62
|
+
- app/mailers/swagger_ui_rails_engine/application_mailer.rb
|
63
|
+
- app/models/swagger_ui_rails_engine/application_record.rb
|
64
|
+
- app/views/swagger_ui_rails_engine/layouts/swagger.html.erb
|
65
|
+
- app/views/swagger_ui_rails_engine/swagger_docs/index.html.erb
|
66
|
+
- app/views/swagger_ui_rails_engine/swagger_docs/show.html.erb
|
67
|
+
- config/routes.rb
|
68
|
+
- lib/swagger_ui_rails_engine.rb
|
69
|
+
- lib/swagger_ui_rails_engine/configuration.rb
|
70
|
+
- lib/swagger_ui_rails_engine/defaults.rb
|
71
|
+
- lib/swagger_ui_rails_engine/engine.rb
|
72
|
+
- lib/swagger_ui_rails_engine/version.rb
|
73
|
+
- lib/tasks/swagger_ui_rails_engine_tasks.rake
|
74
|
+
homepage: https://github.com/bacosmin/swagger_ui_rails_engine
|
75
|
+
licenses:
|
76
|
+
- MIT
|
77
|
+
metadata: {}
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options: []
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
requirements: []
|
93
|
+
rubygems_version: 3.0.1
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: Wrapper over swagger ui
|
97
|
+
test_files: []
|