grape_swagger_ui 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +24 -0
- data/app/assets/images/grape_swagger_ui/explorer_icons.png +0 -0
- data/app/assets/images/grape_swagger_ui/throbber.gif +0 -0
- data/app/assets/javascripts/grape_swagger_ui/application.js +24 -0
- data/app/assets/javascripts/grape_swagger_ui/backbone-min.js +38 -0
- data/app/assets/javascripts/grape_swagger_ui/handlebars-1.0.0.js +2278 -0
- data/app/assets/javascripts/grape_swagger_ui/highlight.7.3.pack.js +1 -0
- data/app/assets/javascripts/grape_swagger_ui/jquery-1.8.0.min.js +2 -0
- data/app/assets/javascripts/grape_swagger_ui/jquery.ba-bbq.min.js +18 -0
- data/app/assets/javascripts/grape_swagger_ui/jquery.slideto.min.js +1 -0
- data/app/assets/javascripts/grape_swagger_ui/jquery.wiggle.min.js +8 -0
- data/app/assets/javascripts/grape_swagger_ui/shred.bundle.js +2765 -0
- data/app/assets/javascripts/grape_swagger_ui/shred/content.js +193 -0
- data/app/assets/javascripts/grape_swagger_ui/swagger-oauth.js +211 -0
- data/app/assets/javascripts/grape_swagger_ui/swagger-ui.js +2324 -0
- data/app/assets/javascripts/grape_swagger_ui/swagger.js +1653 -0
- data/app/assets/javascripts/grape_swagger_ui/underscore-min.js +32 -0
- data/app/assets/stylesheets/grape_swagger_ui/application.css +15 -0
- data/app/assets/stylesheets/grape_swagger_ui/reset.css +125 -0
- data/app/assets/stylesheets/grape_swagger_ui/screen.css.scss +1224 -0
- data/app/controllers/grape_swagger_ui/api_doc_controller.rb +8 -0
- data/app/controllers/grape_swagger_ui/application_controller.rb +10 -0
- data/app/helpers/grape_swagger_ui/application_helper.rb +4 -0
- data/app/views/grape_swagger_ui/api_doc/index.html.erb +2 -0
- data/app/views/layouts/grape_swagger_ui/application.html.erb +55 -0
- data/config/routes.rb +3 -0
- data/lib/grape_swagger_ui.rb +11 -0
- data/lib/grape_swagger_ui/engine.rb +5 -0
- data/lib/grape_swagger_ui/version.rb +3 -0
- data/lib/tasks/grape_swagger_ui_tasks.rake +4 -0
- metadata +91 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>GrapeSwaggerUi</title>
|
5
|
+
<%= stylesheet_link_tag "grape_swagger_ui/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "grape_swagger_ui/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
$(function () {
|
11
|
+
window.swaggerUi = new SwaggerUi({
|
12
|
+
url: '<%= GrapeSwaggerUi.url %>',
|
13
|
+
dom_id: '<%= GrapeSwaggerUi.dom_id %>',
|
14
|
+
supportedSubmitMethods: <%= GrapeSwaggerUi.supported_submit_methods.to_json.html_safe %>,
|
15
|
+
onComplete: function(swaggerApi, swaggerUi){
|
16
|
+
log("Loaded SwaggerUI");
|
17
|
+
|
18
|
+
if(typeof initOAuth == "function") {
|
19
|
+
/*
|
20
|
+
initOAuth({
|
21
|
+
clientId: "your-client-id",
|
22
|
+
realm: "your-realms",
|
23
|
+
appName: "your-app-name"
|
24
|
+
});
|
25
|
+
*/
|
26
|
+
}
|
27
|
+
$('pre code').each(function(i, e) {
|
28
|
+
hljs.highlightBlock(e)
|
29
|
+
});
|
30
|
+
},
|
31
|
+
onFailure: function(data) {
|
32
|
+
log("Unable to Load SwaggerUI");
|
33
|
+
},
|
34
|
+
docExpansion: '<%= GrapeSwaggerUi.doc_expansion %>',
|
35
|
+
sorter : '<%= GrapeSwaggerUi.sorter %>'
|
36
|
+
});
|
37
|
+
|
38
|
+
$('#input_apiKey').change(function() {
|
39
|
+
var key = $('#input_apiKey')[0].value;
|
40
|
+
log("key: " + key);
|
41
|
+
if(key && key.trim() != "") {
|
42
|
+
log("added key " + key);
|
43
|
+
window.authorizations.add("key", new ApiKeyAuthorization("api_key", key, "query"));
|
44
|
+
}
|
45
|
+
})
|
46
|
+
window.swaggerUi.load();
|
47
|
+
});
|
48
|
+
</script>
|
49
|
+
</head>
|
50
|
+
|
51
|
+
<body class="swagger-section">
|
52
|
+
<%= yield %>
|
53
|
+
</body>
|
54
|
+
</html>
|
55
|
+
|
data/config/routes.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require "grape_swagger_ui/engine"
|
2
|
+
|
3
|
+
module GrapeSwaggerUi
|
4
|
+
|
5
|
+
mattr_accessor(:url) { '/api/swagger_doc' }
|
6
|
+
mattr_accessor(:doc_expansion) { 'none' }
|
7
|
+
mattr_accessor(:dom_id) { 'swagger-ui-container' }
|
8
|
+
mattr_accessor(:supported_submit_methods) { ['get', 'post', 'put', 'delete', 'patch'] }
|
9
|
+
mattr_accessor(:sorter) { 'alpha' }
|
10
|
+
mattr_accessor(:authenticate_method) { -> { puts 'No Authentication Required.' } }
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: grape_swagger_ui
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ismail Akram
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-12 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.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.0
|
27
|
+
description: Swagger UI for Grapes in rails. this is using old version of swagger
|
28
|
+
UI, as there is some bug that not let display model schema in latest version and
|
29
|
+
also latest swagger-ui do not works great with grape-swagger
|
30
|
+
email:
|
31
|
+
- rubyonrails3@gmail.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- MIT-LICENSE
|
37
|
+
- Rakefile
|
38
|
+
- app/assets/images/grape_swagger_ui/explorer_icons.png
|
39
|
+
- app/assets/images/grape_swagger_ui/throbber.gif
|
40
|
+
- app/assets/javascripts/grape_swagger_ui/application.js
|
41
|
+
- app/assets/javascripts/grape_swagger_ui/backbone-min.js
|
42
|
+
- app/assets/javascripts/grape_swagger_ui/handlebars-1.0.0.js
|
43
|
+
- app/assets/javascripts/grape_swagger_ui/highlight.7.3.pack.js
|
44
|
+
- app/assets/javascripts/grape_swagger_ui/jquery-1.8.0.min.js
|
45
|
+
- app/assets/javascripts/grape_swagger_ui/jquery.ba-bbq.min.js
|
46
|
+
- app/assets/javascripts/grape_swagger_ui/jquery.slideto.min.js
|
47
|
+
- app/assets/javascripts/grape_swagger_ui/jquery.wiggle.min.js
|
48
|
+
- app/assets/javascripts/grape_swagger_ui/shred.bundle.js
|
49
|
+
- app/assets/javascripts/grape_swagger_ui/shred/content.js
|
50
|
+
- app/assets/javascripts/grape_swagger_ui/swagger-oauth.js
|
51
|
+
- app/assets/javascripts/grape_swagger_ui/swagger-ui.js
|
52
|
+
- app/assets/javascripts/grape_swagger_ui/swagger.js
|
53
|
+
- app/assets/javascripts/grape_swagger_ui/underscore-min.js
|
54
|
+
- app/assets/stylesheets/grape_swagger_ui/application.css
|
55
|
+
- app/assets/stylesheets/grape_swagger_ui/reset.css
|
56
|
+
- app/assets/stylesheets/grape_swagger_ui/screen.css.scss
|
57
|
+
- app/controllers/grape_swagger_ui/api_doc_controller.rb
|
58
|
+
- app/controllers/grape_swagger_ui/application_controller.rb
|
59
|
+
- app/helpers/grape_swagger_ui/application_helper.rb
|
60
|
+
- app/views/grape_swagger_ui/api_doc/index.html.erb
|
61
|
+
- app/views/layouts/grape_swagger_ui/application.html.erb
|
62
|
+
- config/routes.rb
|
63
|
+
- lib/grape_swagger_ui.rb
|
64
|
+
- lib/grape_swagger_ui/engine.rb
|
65
|
+
- lib/grape_swagger_ui/version.rb
|
66
|
+
- lib/tasks/grape_swagger_ui_tasks.rake
|
67
|
+
homepage: https://github.com/rubyonrails3/grape-swagger-ui
|
68
|
+
licenses:
|
69
|
+
- MIT
|
70
|
+
metadata: {}
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 2.2.2
|
88
|
+
signing_key:
|
89
|
+
specification_version: 4
|
90
|
+
summary: Swagger UI for Grapes in rails.
|
91
|
+
test_files: []
|